pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] pspp tests/formats/format-guesser.sh src/data/f...


From: Ben Pfaff
Subject: [Pspp-cvs] pspp tests/formats/format-guesser.sh src/data/f...
Date: Fri, 07 Mar 2008 05:28:30 +0000

CVSROOT:        /cvsroot/pspp
Module name:    pspp
Changes by:     Ben Pfaff <blp> 08/03/07 05:28:30

Modified files:
        tests/formats  : format-guesser.sh 
        src/data       : format-guesser.c ChangeLog 

Log message:
        Require month names to be spelled out as English words, so that single
        characters that happen to be Roman numerals don't get detected as
        months.  Thanks to John Darrington for reporting this bug.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/tests/formats/format-guesser.sh?cvsroot=pspp&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/format-guesser.c?cvsroot=pspp&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/ChangeLog?cvsroot=pspp&r1=1.191&r2=1.192

Patches:
Index: tests/formats/format-guesser.sh
===================================================================
RCS file: /cvsroot/pspp/pspp/tests/formats/format-guesser.sh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- tests/formats/format-guesser.sh     5 Mar 2008 06:09:54 -0000       1.1
+++ tests/formats/format-guesser.sh     7 Mar 2008 05:28:29 -0000       1.2
@@ -94,6 +94,7 @@
 
 # Date and time formats.
 "01-OCT-1978" => DATE11
+"01-x-1978" => EDATE9          # Roman numeral for month.
 "01-13-99" => ADATE8
 "1-13-99" => ADATE7 (ADATE8)
 "13-01-99" => EDATE8
@@ -135,20 +136,10 @@
 "jan" => MONTH3
 "Feb" => MONTH3
 "MAR" => MONTH3
-"i" => MONTH1 (MONTH3)
-"ii" => MONTH2 (MONTH3)
-"iii" => MONTH3
-"iiii" => A4
-"iv" => MONTH2 (MONTH3)
-"v" => MONTH1 (MONTH3)
-"vi" => MONTH2 (MONTH3)
-"vii" => MONTH3
-"viii" => MONTH4
-"ix" => MONTH2 (MONTH3)
-"viiii" => A5
-"x" => MONTH1 (MONTH3)
-"xi" => MONTH2 (MONTH3)
-"xii" => MONTH3
+"i" => A1                      # Not detected as MONTH format.
+"v" => A1
+"ix" => A2
+"x" => A1
 "january" => MONTH7
 "janaury" => MONTH7
 "february" => MONTH8

Index: src/data/format-guesser.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/format-guesser.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- src/data/format-guesser.c   5 Mar 2008 06:09:54 -0000       1.1
+++ src/data/format-guesser.c   7 Mar 2008 05:28:29 -0000       1.2
@@ -135,8 +135,13 @@
     /* www */
     { FMT_WKDAY, 1, {DT_WEEKDAY} },
 
-    /* mmm */
-    { FMT_MONTH, 1, {DT_MONTH} },
+    /* mmm
+
+       We require a spelled-out English month so that
+       single-character Roman numerals like "i" and "x" don't get
+       detected as months.  The latter is particularly common in
+       the password field of /etc/passwd-like files. */
+    { FMT_MONTH, 1, {DT_ENGLISH_MONTH} },
   };
 
 /* Number of recognized date syntax formats. */

Index: src/data/ChangeLog
===================================================================
RCS file: /cvsroot/pspp/pspp/src/data/ChangeLog,v
retrieving revision 1.191
retrieving revision 1.192
diff -u -b -r1.191 -r1.192
--- src/data/ChangeLog  5 Mar 2008 06:09:55 -0000       1.191
+++ src/data/ChangeLog  7 Mar 2008 05:28:30 -0000       1.192
@@ -1,3 +1,10 @@
+2008-03-06  Ben Pfaff  <address@hidden>
+
+       * format-guesser.c (syntax): Require month names to be spelled out
+       as English words, so that single characters that happen to be
+       Roman numerals don't get detected as months.  Thanks to John
+       Darrington for reporting this bug.
+
 2008-03-04  Ben Pfaff  <address@hidden>
 
        Patch #6441.  Reviewed by John Darrington.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]