Blame SOURCES/shadow-4.2.1-date-parsing.patch

4fb1b2
Index: shadow-4.5/libmisc/getdate.y
4fb1b2
===================================================================
4fb1b2
--- shadow-4.5.orig/libmisc/getdate.y
4fb1b2
+++ shadow-4.5/libmisc/getdate.y
4fb1b2
@@ -152,6 +152,7 @@ static int	yyHaveDay;
4fb1b2
 static int	yyHaveRel;
4fb1b2
 static int	yyHaveTime;
4fb1b2
 static int	yyHaveZone;
4fb1b2
+static int      yyHaveYear;
4fb1b2
 static int	yyTimezone;
4fb1b2
 static int	yyDay;
4fb1b2
 static int	yyHour;
4fb1b2
@@ -293,18 +294,21 @@ date	: tUNUMBER '/' tUNUMBER {
4fb1b2
 	      yyDay = $3;
4fb1b2
 	      yyYear = $5;
4fb1b2
 	    }
4fb1b2
+	    yyHaveYear++;
4fb1b2
 	}
4fb1b2
 	| tUNUMBER tSNUMBER tSNUMBER {
4fb1b2
 	    /* ISO 8601 format.  yyyy-mm-dd.  */
4fb1b2
 	    yyYear = $1;
4fb1b2
 	    yyMonth = -$2;
4fb1b2
 	    yyDay = -$3;
4fb1b2
+	    yyHaveYear++;
4fb1b2
 	}
4fb1b2
 	| tUNUMBER tMONTH tSNUMBER {
4fb1b2
 	    /* e.g. 17-JUN-1992.  */
4fb1b2
 	    yyDay = $1;
4fb1b2
 	    yyMonth = $2;
4fb1b2
 	    yyYear = -$3;
4fb1b2
+	    yyHaveYear++;
4fb1b2
 	}
4fb1b2
 	| tMONTH tUNUMBER {
4fb1b2
 	    yyMonth = $1;
4fb1b2
@@ -314,6 +318,7 @@ date	: tUNUMBER '/' tUNUMBER {
4fb1b2
 	    yyMonth = $1;
4fb1b2
 	    yyDay = $2;
4fb1b2
 	    yyYear = $4;
4fb1b2
+	    yyHaveYear++;
4fb1b2
 	}
4fb1b2
 	| tUNUMBER tMONTH {
4fb1b2
 	    yyMonth = $2;
4fb1b2
@@ -323,6 +328,7 @@ date	: tUNUMBER '/' tUNUMBER {
4fb1b2
 	    yyMonth = $2;
4fb1b2
 	    yyDay = $1;
4fb1b2
 	    yyYear = $3;
4fb1b2
+	    yyHaveYear++;
4fb1b2
 	}
4fb1b2
 	;
4fb1b2
 
4fb1b2
@@ -395,7 +401,8 @@ relunit	: tUNUMBER tYEAR_UNIT {
4fb1b2
 
4fb1b2
 number	: tUNUMBER
4fb1b2
           {
4fb1b2
-	    if ((yyHaveTime != 0) && (yyHaveDate != 0) && (yyHaveRel == 0))
4fb1b2
+	    if ((yyHaveTime != 0 || $1 >= 100) && !yyHaveYear
4fb1b2
+		&& (yyHaveDate != 0) && (yyHaveRel == 0))
4fb1b2
 	      yyYear = $1;
4fb1b2
 	    else
4fb1b2
 	      {
4fb1b2
@@ -802,7 +809,7 @@ yylex (void)
4fb1b2
 	  return LookupWord (buff);
4fb1b2
 	}
4fb1b2
       if (c != '(')
4fb1b2
-	return *yyInput++;
4fb1b2
+	return (unsigned char)*yyInput++;
4fb1b2
       Count = 0;
4fb1b2
       do
4fb1b2
 	{