Module Name: src Committed By: snj Date: Sat Oct 11 16:51:23 UTC 2014
Modified Files: src/lib/libutil [netbsd-7]: parsedate.y Log Message: Pull up following revision(s) (requested by apb in ticket #135): lib/libutil/parsedate.y: revision 1.19 Previously, input of the form "HH:MM:SS +ZZZZ" would not have set the yyhaveZone flag. To generate a diff of this commit: cvs rdiff -u -r1.16.6.2 -r1.16.6.3 src/lib/libutil/parsedate.y Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libutil/parsedate.y diff -u src/lib/libutil/parsedate.y:1.16.6.2 src/lib/libutil/parsedate.y:1.16.6.3 --- src/lib/libutil/parsedate.y:1.16.6.2 Sat Oct 11 16:47:48 2014 +++ src/lib/libutil/parsedate.y Sat Oct 11 16:51:23 2014 @@ -14,7 +14,7 @@ #include <sys/cdefs.h> #ifdef __RCSID -__RCSID("$NetBSD: parsedate.y,v 1.16.6.2 2014/10/11 16:47:48 snj Exp $"); +__RCSID("$NetBSD: parsedate.y,v 1.16.6.3 2014/10/11 16:51:23 snj Exp $"); #endif #include <stdio.h> @@ -118,6 +118,10 @@ spec : /* NULL */ item : time { param->yyHaveTime++; } + | time_numericzone { + param->yyHaveTime++; + param->yyHaveZone++; + } | zone { param->yyHaveZone++; } @@ -197,33 +201,35 @@ time : tUNUMBER tMERIDIAN { param->yySeconds = 0; param->yyMeridian = $4; } - | tUNUMBER ':' tUNUMBER tSNUMBER { - param->yyHour = $1; - param->yyMinutes = $3; - param->yyMeridian = MER24; - param->yyDSTmode = DSToff; - param->yyTimezone = - ($4 % 100 + ($4 / 100) * 60); - } | tUNUMBER ':' tUNUMBER ':' tUNUMBER o_merid { param->yyHour = $1; param->yyMinutes = $3; param->yySeconds = $5; param->yyMeridian = $6; } - | tUNUMBER ':' tUNUMBER ':' tUNUMBER tSNUMBER { + | tUNUMBER ':' tUNUMBER ':' tUNUMBER '.' tUNUMBER { param->yyHour = $1; param->yyMinutes = $3; param->yySeconds = $5; param->yyMeridian = MER24; +/* XXX: Do nothing with millis */ + } + ; + +time_numericzone : tUNUMBER ':' tUNUMBER tSNUMBER { + param->yyHour = $1; + param->yyMinutes = $3; + param->yyMeridian = MER24; param->yyDSTmode = DSToff; - param->yyTimezone = - ($6 % 100 + ($6 / 100) * 60); + param->yyTimezone = - ($4 % 100 + ($4 / 100) * 60); } - | tUNUMBER ':' tUNUMBER ':' tUNUMBER '.' tUNUMBER { + | tUNUMBER ':' tUNUMBER ':' tUNUMBER tSNUMBER { param->yyHour = $1; param->yyMinutes = $3; param->yySeconds = $5; param->yyMeridian = MER24; -/* XXX: Do nothing with millis */ + param->yyDSTmode = DSToff; + param->yyTimezone = - ($6 % 100 + ($6 / 100) * 60); } ;