Module Name:    src
Committed By:   christos
Date:           Mon Apr 20 22:22:08 UTC 2009

Modified Files:
        src/external/gpl2/xcvs/dist/lib: getdate.y

Log Message:
Put back cvsstamp support. From Anon Ymous


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/xcvs/dist/lib/getdate.y

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/xcvs/dist/lib/getdate.y
diff -u src/external/gpl2/xcvs/dist/lib/getdate.y:1.1.1.1 src/external/gpl2/xcvs/dist/lib/getdate.y:1.2
--- src/external/gpl2/xcvs/dist/lib/getdate.y:1.1.1.1	Tue Apr  7 18:10:20 2009
+++ src/external/gpl2/xcvs/dist/lib/getdate.y	Mon Apr 20 18:22:08 2009
@@ -257,9 +257,41 @@
       { pc->days_seen++; }
   | rel
       { pc->rels_seen = true; }
+  | cvsstamp
+      {
+        pc->dates_seen++;
+        pc->zones_seen++;
+        pc->times_seen++;
+      }
   | number
   ;
 
+cvsstamp: tUDECIMAL_NUMBER '.' tUDECIMAL_NUMBER '.' tUDECIMAL_NUMBER
+  {
+    int i;
+    pc->year.negative = 0;
+    pc->year.value = $1.tv_sec;
+
+    if (pc->year.value < 70)
+      pc->year.value += 2000;
+    else if (pc->year.value < 100)
+      pc->year.value += 1900;
+
+    for (i = pc->year.value, pc->year.digits = 0; i; i /= 10, pc->year.digits++)
+      continue;
+    if (pc->year.digits == 0)
+      pc->year.digits++;
+
+    pc->month = $1.tv_nsec / 10000000;
+    pc->day = $3.tv_sec;
+    pc->hour = $3.tv_nsec / 10000000;
+    pc->minutes = $5.tv_sec;
+    pc->seconds.tv_sec = $5.tv_nsec / 10000000;
+    pc->seconds.tv_nsec = 0;
+    pc->meridian = MER24;
+    pc->time_zone = 0;
+  }
+
 time:
     tUNUMBER tMERIDIAN
       {

Reply via email to