summaryrefslogtreecommitdiff
path: root/src/times.cc
diff options
context:
space:
mode:
authorMartin Michlmayr <tbm@cyrius.com>2014-05-30 18:27:22 -0400
committerMartin Michlmayr <tbm@cyrius.com>2014-05-30 18:27:22 -0400
commitfafd7c13460c872c7c5736932a4264a6a3b1fbe5 (patch)
treeb076b0503ba960e4bc76948880c2109b2e03fe81 /src/times.cc
parentb6b6a98d0daeb537d1c0f814bace92939d564f1b (diff)
downloadfork-ledger-fafd7c13460c872c7c5736932a4264a6a3b1fbe5.tar.gz
fork-ledger-fafd7c13460c872c7c5736932a4264a6a3b1fbe5.tar.bz2
fork-ledger-fafd7c13460c872c7c5736932a4264a6a3b1fbe5.zip
Check whether a month is followed by a year
Bug fix for #375
Diffstat (limited to 'src/times.cc')
-rw-r--r--src/times.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/times.cc b/src/times.cc
index 3fd9a1df..b527de87 100644
--- a/src/times.cc
+++ b/src/times.cc
@@ -839,6 +839,17 @@ void date_parser_t::determine_when(date_parser_t::lexer_t::token_t& tok,
specifier.month =
date_specifier_t::month_type
(boost::get<date_time::months_of_year>(*tok.value));
+ tok = lexer.next_token();
+ switch (tok.kind) {
+ case lexer_t::token_t::TOK_A_YEAR:
+ specifier.year = boost::get<date_specifier_t::year_type>(*tok.value);
+ break;
+ case lexer_t::token_t::END_REACHED:
+ break;
+ default:
+ tok.unexpected();
+ break;
+ }
break;
case lexer_t::token_t::TOK_A_WDAY:
specifier.wday =