|
|
827aa9 |
diff -up shadow-4.1.5.1/libmisc/getdate.c.date-parsing shadow-4.1.5.1/libmisc/getdate.c
|
|
|
827aa9 |
--- shadow-4.1.5.1/libmisc/getdate.c.date-parsing 2008-06-14 00:07:51.000000000 +0200
|
|
|
827aa9 |
+++ shadow-4.1.5.1/libmisc/getdate.c 2014-08-29 13:41:22.553267506 +0200
|
|
|
827aa9 |
@@ -261,6 +261,7 @@ static int yyHaveDay;
|
|
|
827aa9 |
static int yyHaveRel;
|
|
|
827aa9 |
static int yyHaveTime;
|
|
|
827aa9 |
static int yyHaveZone;
|
|
|
827aa9 |
+static int yyHaveYear;
|
|
|
827aa9 |
static int yyTimezone;
|
|
|
827aa9 |
static int yyDay;
|
|
|
827aa9 |
static int yyHour;
|
|
|
827aa9 |
@@ -1730,6 +1731,7 @@ yyreduce:
|
|
|
827aa9 |
yyDay = (yyvsp[(3) - (5)].Number);
|
|
|
827aa9 |
yyYear = (yyvsp[(5) - (5)].Number);
|
|
|
827aa9 |
}
|
|
|
827aa9 |
+ yyHaveYear++;
|
|
|
827aa9 |
}
|
|
|
827aa9 |
break;
|
|
|
827aa9 |
|
|
|
827aa9 |
@@ -1740,6 +1742,7 @@ yyreduce:
|
|
|
827aa9 |
yyYear = (yyvsp[(1) - (3)].Number);
|
|
|
827aa9 |
yyMonth = -(yyvsp[(2) - (3)].Number);
|
|
|
827aa9 |
yyDay = -(yyvsp[(3) - (3)].Number);
|
|
|
827aa9 |
+ yyHaveYear++;
|
|
|
827aa9 |
}
|
|
|
827aa9 |
break;
|
|
|
827aa9 |
|
|
|
827aa9 |
@@ -1750,6 +1753,7 @@ yyreduce:
|
|
|
827aa9 |
yyDay = (yyvsp[(1) - (3)].Number);
|
|
|
827aa9 |
yyMonth = (yyvsp[(2) - (3)].Number);
|
|
|
827aa9 |
yyYear = -(yyvsp[(3) - (3)].Number);
|
|
|
827aa9 |
+ yyHaveYear++;
|
|
|
827aa9 |
}
|
|
|
827aa9 |
break;
|
|
|
827aa9 |
|
|
|
827aa9 |
@@ -1767,6 +1771,7 @@ yyreduce:
|
|
|
827aa9 |
yyMonth = (yyvsp[(1) - (4)].Number);
|
|
|
827aa9 |
yyDay = (yyvsp[(2) - (4)].Number);
|
|
|
827aa9 |
yyYear = (yyvsp[(4) - (4)].Number);
|
|
|
827aa9 |
+ yyHaveYear++;
|
|
|
827aa9 |
}
|
|
|
827aa9 |
break;
|
|
|
827aa9 |
|
|
|
827aa9 |
@@ -1784,6 +1789,7 @@ yyreduce:
|
|
|
827aa9 |
yyMonth = (yyvsp[(2) - (3)].Number);
|
|
|
827aa9 |
yyDay = (yyvsp[(1) - (3)].Number);
|
|
|
827aa9 |
yyYear = (yyvsp[(3) - (3)].Number);
|
|
|
827aa9 |
+ yyHaveYear++;
|
|
|
827aa9 |
}
|
|
|
827aa9 |
break;
|
|
|
827aa9 |
|
|
|
827aa9 |
@@ -1928,7 +1934,8 @@ yyreduce:
|
|
|
827aa9 |
case 49:
|
|
|
827aa9 |
#line 397 "getdate.y"
|
|
|
827aa9 |
{
|
|
|
827aa9 |
- if ((yyHaveTime != 0) && (yyHaveDate != 0) && (yyHaveRel == 0))
|
|
|
827aa9 |
+ if ((yyHaveTime != 0 || (yyvsp[(1) - (1)].Number) >= 100) && !yyHaveYear
|
|
|
827aa9 |
+ && (yyHaveDate != 0) && (yyHaveRel == 0))
|
|
|
827aa9 |
yyYear = (yyvsp[(1) - (1)].Number);
|
|
|
827aa9 |
else
|
|
|
827aa9 |
{
|
|
|
827aa9 |
@@ -2556,7 +2563,7 @@ yylex (void)
|
|
|
827aa9 |
return LookupWord (buff);
|
|
|
827aa9 |
}
|
|
|
827aa9 |
if (c != '(')
|
|
|
827aa9 |
- return *yyInput++;
|
|
|
827aa9 |
+ return (unsigned char)*yyInput++;
|
|
|
827aa9 |
Count = 0;
|
|
|
827aa9 |
do
|
|
|
827aa9 |
{
|
|
|
827aa9 |
diff -up shadow-4.1.5.1/libmisc/getdate.y.date-parsing shadow-4.1.5.1/libmisc/getdate.y
|
|
|
827aa9 |
--- shadow-4.1.5.1/libmisc/getdate.y.date-parsing 2008-05-26 10:57:51.000000000 +0200
|
|
|
827aa9 |
+++ shadow-4.1.5.1/libmisc/getdate.y 2014-08-29 13:40:37.502229879 +0200
|
|
|
827aa9 |
@@ -152,6 +152,7 @@ static int yyHaveDay;
|
|
|
827aa9 |
static int yyHaveRel;
|
|
|
827aa9 |
static int yyHaveTime;
|
|
|
827aa9 |
static int yyHaveZone;
|
|
|
827aa9 |
+static int yyHaveYear;
|
|
|
827aa9 |
static int yyTimezone;
|
|
|
827aa9 |
static int yyDay;
|
|
|
827aa9 |
static int yyHour;
|
|
|
827aa9 |
@@ -293,18 +294,21 @@ date : tUNUMBER '/' tUNUMBER {
|
|
|
827aa9 |
yyDay = $3;
|
|
|
827aa9 |
yyYear = $5;
|
|
|
827aa9 |
}
|
|
|
827aa9 |
+ yyHaveYear++;
|
|
|
827aa9 |
}
|
|
|
827aa9 |
| tUNUMBER tSNUMBER tSNUMBER {
|
|
|
827aa9 |
/* ISO 8601 format. yyyy-mm-dd. */
|
|
|
827aa9 |
yyYear = $1;
|
|
|
827aa9 |
yyMonth = -$2;
|
|
|
827aa9 |
yyDay = -$3;
|
|
|
827aa9 |
+ yyHaveYear++;
|
|
|
827aa9 |
}
|
|
|
827aa9 |
| tUNUMBER tMONTH tSNUMBER {
|
|
|
827aa9 |
/* e.g. 17-JUN-1992. */
|
|
|
827aa9 |
yyDay = $1;
|
|
|
827aa9 |
yyMonth = $2;
|
|
|
827aa9 |
yyYear = -$3;
|
|
|
827aa9 |
+ yyHaveYear++;
|
|
|
827aa9 |
}
|
|
|
827aa9 |
| tMONTH tUNUMBER {
|
|
|
827aa9 |
yyMonth = $1;
|
|
|
827aa9 |
@@ -314,6 +318,7 @@ date : tUNUMBER '/' tUNUMBER {
|
|
|
827aa9 |
yyMonth = $1;
|
|
|
827aa9 |
yyDay = $2;
|
|
|
827aa9 |
yyYear = $4;
|
|
|
827aa9 |
+ yyHaveYear++;
|
|
|
827aa9 |
}
|
|
|
827aa9 |
| tUNUMBER tMONTH {
|
|
|
827aa9 |
yyMonth = $2;
|
|
|
827aa9 |
@@ -323,6 +328,7 @@ date : tUNUMBER '/' tUNUMBER {
|
|
|
827aa9 |
yyMonth = $2;
|
|
|
827aa9 |
yyDay = $1;
|
|
|
827aa9 |
yyYear = $3;
|
|
|
827aa9 |
+ yyHaveYear++;
|
|
|
827aa9 |
}
|
|
|
827aa9 |
;
|
|
|
827aa9 |
|
|
|
827aa9 |
@@ -395,7 +401,8 @@ relunit : tUNUMBER tYEAR_UNIT {
|
|
|
827aa9 |
|
|
|
827aa9 |
number : tUNUMBER
|
|
|
827aa9 |
{
|
|
|
827aa9 |
- if ((yyHaveTime != 0) && (yyHaveDate != 0) && (yyHaveRel == 0))
|
|
|
827aa9 |
+ if ((yyHaveTime != 0 || $1 >= 100) && !yyHaveYear
|
|
|
827aa9 |
+ && (yyHaveDate != 0) && (yyHaveRel == 0))
|
|
|
827aa9 |
yyYear = $1;
|
|
|
827aa9 |
else
|
|
|
827aa9 |
{
|
|
|
827aa9 |
@@ -802,7 +809,7 @@ yylex (void)
|
|
|
827aa9 |
return LookupWord (buff);
|
|
|
827aa9 |
}
|
|
|
827aa9 |
if (c != '(')
|
|
|
827aa9 |
- return *yyInput++;
|
|
|
827aa9 |
+ return (unsigned char)*yyInput++;
|
|
|
827aa9 |
Count = 0;
|
|
|
827aa9 |
do
|
|
|
827aa9 |
{
|