]> diplodocus.org Git - nmh/blobdiff - sbr/dtimep.l
man/*.man: Fix some multi-word .B invocations.
[nmh] / sbr / dtimep.l
index 29c4dd0c21d4f7aa11eaf9d7aa7504e6f39900cb..05a6d90bc5cc855d97dbee69c49cd9d5a2a4a189 100644 (file)
   /* Since we're looking at a string at a time, don't worry about
    *  wrapping to the next buffer.
    */
+#if YY_FLEX_MAJOR_VERSION == 2 && \
+    YY_FLEX_MINOR_VERSION == 6 && \
+    YY_FLEX_SUBMINOR_VERSION == 3
+/* https://github.com/westes/flex/issues/162 */
+#undef yywrap
+#endif
 #define yywrap() 1
 #define YY_SKIP_YYWRAP
 
@@ -126,7 +132,7 @@ static int day_map[] = {
                        tw.tw_flags &= ~TW_SDAY; tw.tw_flags |= TW_SEXP; \
                        SKIPA(); }
 #define SETMON()     { cp++; \
-                       tw.tw_mon = month_map[(cp[0] + cp[1]) & 0x1f]; \
+                       tw.tw_mon = month_map[(((unsigned char) cp[0]) + ((unsigned char) cp[1])) & 0x1f]; \
                       SKIPA(); }
 #define SETMON_NUM() { tw.tw_mon = atoi(cp)-1; \
                       SKIPD(); }
@@ -146,17 +152,17 @@ static int day_map[] = {
                        tw.tw_flags |= TW_SZEXP; \
                        SKIPD(); }
 #define SETDST()     { tw.tw_flags |= TW_DST; }
-#define SKIPD()      { while ( isdigit(*cp++) ) ; \
+#define SKIPD()      { while ( isdigit((unsigned char) *cp++) ) ; \
                        --cp; }
-#define SKIPTOD()    { while ( !isdigit(*cp++) ) ; \
+#define SKIPTOD()    { while ( !isdigit((unsigned char) *cp++) ) ; \
                        --cp; }
-#define SKIPA()      { while ( isalpha(*cp++) ) ; \
+#define SKIPA()      { while ( isalpha((unsigned char) *cp++) ) ; \
                        --cp; }
-#define SKIPTOA()    { while ( !isalpha(*cp++) ) ; \
+#define SKIPTOA()    { while ( !isalpha((unsigned char) *cp++) ) ; \
                        --cp; }
-#define SKIPSP()     { while ( isspace(*cp++) ) ; \
+#define SKIPSP()     { while ( isspace((unsigned char) *cp++) ) ; \
                        --cp; }
-#define SKIPTOSP()   { while ( !isspace(*cp++) ) ; \
+#define SKIPTOSP()   { while ( !isspace((unsigned char) *cp++) ) ; \
                        --cp; }
 
 #ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST
@@ -168,7 +174,7 @@ static int day_map[] = {
 static void
 zonehack (struct tws *tw)
 {
-    register struct tm *tm;
+    struct tm *tm;
 
     if (dmktime (tw) == (time_t) -1)
        return;
@@ -230,7 +236,7 @@ nl      [ \t\n()]
   
   YY_BUFFER_STATE lexhandle;
 
-  register unsigned char *cp;
+  char *cp;
   static struct tws tw; 
 
   memset(&tw,0,sizeof(struct tws));