]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Track first and last parsed token.
authorTim Kientzle <kientzle@gmail.com>
Sun, 22 Feb 2009 06:41:48 +0000 (01:41 -0500)
committerTim Kientzle <kientzle@gmail.com>
Sun, 22 Feb 2009 06:41:48 +0000 (01:41 -0500)
SVN-Revision: 695

tar/getdate.c
tar/getdate.y

index 3e32f1359b9d08b138127b0f51f9911000714800..e521810dd98fa3a4dadf03e7081a134ec1df4923 100644 (file)
@@ -115,7 +115,7 @@ static time_t       yyRelSeconds;
 
 struct token { int token; time_t value; };
 static struct token tokens[256];
-struct token *tokenp;
+struct token *tokenp, *lasttoken;
 
 #line 100 "getdate.y"
 typedef union {
@@ -775,10 +775,10 @@ get_date(char *p)
        yyHaveTime = 0;
        yyHaveZone = 0;
 
-       tokenp = tokens;
-       while ((tokenp->token = nexttoken(&p, &tokenp->value)) != 0) {
-               ++tokenp;
-               if (tokenp > tokens + 255)
+       lasttoken = tokens;
+       while ((lasttoken->token = nexttoken(&p, &lasttoken->value)) != 0) {
+               ++lasttoken;
+               if (lasttoken > tokens + 255)
                        return -1;
        }
        tokenp = tokens;
index 9ba2cf36eb43b79644d3e4d1622ef3825874e631..1dd5af67f361b3954ad5ef66a3ca18ee9fff6d4e 100644 (file)
@@ -93,7 +93,7 @@ static time_t yyRelSeconds;
 
 struct token { int token; time_t value; };
 static struct token tokens[256];
-struct token *tokenp;
+struct token *tokenp, *lasttoken;
 
 %}
 
@@ -801,10 +801,10 @@ get_date(char *p)
        yyHaveTime = 0;
        yyHaveZone = 0;
 
-       tokenp = tokens;
-       while ((tokenp->token = nexttoken(&p, &tokenp->value)) != 0) {
-               ++tokenp;
-               if (tokenp > tokens + 255)
+       lasttoken = tokens;
+       while ((lasttoken->token = nexttoken(&p, &lasttoken->value)) != 0) {
+               ++lasttoken;
+               if (lasttoken > tokens + 255)
                        return -1;
        }
        tokenp = tokens;