From fafd7c13460c872c7c5736932a4264a6a3b1fbe5 Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Fri, 30 May 2014 18:27:22 -0400 Subject: Check whether a month is followed by a year Bug fix for #375 --- src/times.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/times.cc') 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(*tok.value)); + tok = lexer.next_token(); + switch (tok.kind) { + case lexer_t::token_t::TOK_A_YEAR: + specifier.year = boost::get(*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 = -- cgit v1.2.3