From: Dan Harkless Date: Tue, 14 Mar 2000 21:07:56 +0000 (+0000) Subject: Created new dtimep.c-lexed with Simon's change using dtimep.lex lexed on X-Git-Tag: nmh-1_0~59 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=79f8761e5c4f65083cd06b41e850c548fce8f4f0;p=mmh Created new dtimep.c-lexed with Simon's change using dtimep.lex lexed on Solaris 2.6. Removed my comment about strdup(). The Solaris 2.6 failure was due to failing to do a make distclean after configuring for Ultrix 4.2A. I'll leave the change, though, since it's still a good one (just not worth reporting in the ChangeLog). --- diff --git a/ChangeLog b/ChangeLog index 8d7c45c..0616c3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -45,12 +45,10 @@ Tue Mar 14 12:41:48 2000 Dan Harkless "19 Jan 00" as the date. The following works around this so that scan, show, sortm, etc work ok. - * Added scan.MMDDYY and scan.YYYYMMDD format files. + * Created new dtimep.c-lexed with Simon's change using dtimep.lex + lexed on Solaris 2.6. - * Changed strdup() in strdup.c to take a _const_ char*. Don't - know why this didn't hit anyone before, but I wasn't able to - compile on Solaris 2.6 without doing this, due to a "previous - declaration" error. + * Added scan.MMDDYY and scan.YYYYMMDD format files. Mon Mar 13 21:32:00 2000 Dan Harkless diff --git a/zotnet/tws/dtimep.c-lexed b/zotnet/tws/dtimep.c-lexed index 12a209b..9ad02fa 100644 --- a/zotnet/tws/dtimep.c-lexed +++ b/zotnet/tws/dtimep.c-lexed @@ -256,11 +256,21 @@ case 5: for (i = 0; isdigit(*cp); ) i = i*10 + (*cp++ - '0'); tw.tw_year = i; +#ifdef FIX_NON_Y2K_COMPLIANT_MUA_DATES + /* handle broken mua's that don't add + 1900, or just use the last two + digits. Assume no email before + 1972. */ + if (tw.tw_year < 72) + tw.tw_year += 100; + if (tw.tw_year < 1900) + tw.tw_year += 1900; +#endif /* FIX_NON_Y2K_COMPLIANT_MUA_DATES */ } break; case 6: -# line 261 "./dtimep.lex" +# line 271 "./dtimep.lex" { tw.tw_mday = CVT1OR2; while ( ! isalpha( *cp++ ) ) @@ -270,7 +280,7 @@ case 6: break; case 7: -# line 267 "./dtimep.lex" +# line 277 "./dtimep.lex" { cp++; SETMONTH; @@ -283,7 +293,7 @@ case 7: break; case 8: -# line 276 "./dtimep.lex" +# line 286 "./dtimep.lex" { cp++; SETMONTH; @@ -292,7 +302,7 @@ case 8: break; case 9: -# line 282 "./dtimep.lex" +# line 292 "./dtimep.lex" { /* hack: ctime w/o TZ */ tw.tw_hour = CVT1OR2; cp++; tw.tw_min = CVT1OR2; cp++; @@ -303,7 +313,7 @@ case 9: break; case 10: -# line 289 "./dtimep.lex" +# line 299 "./dtimep.lex" { tw.tw_hour = CVT1OR2; cp++; tw.tw_min = CVT1OR2; cp++; @@ -313,7 +323,7 @@ case 10: break; case 11: -# line 295 "./dtimep.lex" +# line 305 "./dtimep.lex" { tw.tw_hour = CVT1OR2; cp++; tw.tw_min = CVT1OR2; @@ -322,7 +332,7 @@ case 11: break; case 12: -# line 300 "./dtimep.lex" +# line 310 "./dtimep.lex" { tw.tw_hour = CVT1OR2; cp++; if (tw.tw_hour == 12) @@ -333,7 +343,7 @@ case 12: break; case 13: -# line 307 "./dtimep.lex" +# line 317 "./dtimep.lex" { tw.tw_hour = CVT1OR2; cp++; if (tw.tw_hour == 12) @@ -345,7 +355,7 @@ case 13: break; case 14: -# line 315 "./dtimep.lex" +# line 325 "./dtimep.lex" { tw.tw_hour = CVT1OR2; cp++; if (tw.tw_hour != 12) @@ -356,7 +366,7 @@ case 14: break; case 15: -# line 322 "./dtimep.lex" +# line 332 "./dtimep.lex" { tw.tw_hour = CVT1OR2; cp++; if (tw.tw_hour != 12) @@ -368,7 +378,7 @@ case 15: break; case 16: -# line 330 "./dtimep.lex" +# line 340 "./dtimep.lex" { tw.tw_hour = CVT2; cp+=2; tw.tw_min = CVT2; cp+=2; @@ -378,7 +388,7 @@ case 16: break; case 17: -# line 336 "./dtimep.lex" +# line 346 "./dtimep.lex" { /* * Luckly, 4 digit times in the range @@ -390,7 +400,7 @@ case 17: break; case 18: -# line 344 "./dtimep.lex" +# line 354 "./dtimep.lex" { if (tw.tw_hour || tw.tw_min || tw.tw_sec) { @@ -405,107 +415,107 @@ case 18: break; case 19: -# line 355 "./dtimep.lex" +# line 365 "./dtimep.lex" ZONE(0 * 60); break; case 20: -# line 356 "./dtimep.lex" +# line 366 "./dtimep.lex" ZONE(0 * 60); break; case 21: -# line 357 "./dtimep.lex" +# line 367 "./dtimep.lex" ZONE(2 * 60); break; case 22: -# line 358 "./dtimep.lex" +# line 368 "./dtimep.lex" ZONED(2 * 60); break; case 23: -# line 359 "./dtimep.lex" +# line 369 "./dtimep.lex" ZONE(-5 * 60); break; case 24: -# line 360 "./dtimep.lex" +# line 370 "./dtimep.lex" ZONED(-5 * 60); break; case 25: -# line 361 "./dtimep.lex" +# line 371 "./dtimep.lex" ZONE(-6 * 60); break; case 26: -# line 362 "./dtimep.lex" +# line 372 "./dtimep.lex" ZONED(-6 * 60); break; case 27: -# line 363 "./dtimep.lex" +# line 373 "./dtimep.lex" ZONE(-7 * 60); break; case 28: -# line 364 "./dtimep.lex" +# line 374 "./dtimep.lex" ZONED(-7 * 60); break; case 29: -# line 365 "./dtimep.lex" +# line 375 "./dtimep.lex" ZONE(-8 * 60); break; case 30: -# line 366 "./dtimep.lex" +# line 376 "./dtimep.lex" ZONED(-8 * 60); break; case 31: -# line 367 "./dtimep.lex" +# line 377 "./dtimep.lex" ZONE(-(3 * 60 + 30)); break; case 32: -# line 368 "./dtimep.lex" +# line 378 "./dtimep.lex" ZONE(-4 * 60); break; case 33: -# line 369 "./dtimep.lex" +# line 379 "./dtimep.lex" ZONED(-4 * 60); break; case 34: -# line 370 "./dtimep.lex" +# line 380 "./dtimep.lex" ZONE(-9 * 60); break; case 35: -# line 371 "./dtimep.lex" +# line 381 "./dtimep.lex" ZONED(-9 * 60); break; case 36: -# line 372 "./dtimep.lex" +# line 382 "./dtimep.lex" ZONE(-10 * 60); break; case 37: -# line 373 "./dtimep.lex" +# line 383 "./dtimep.lex" ZONED(-10 * 60); break; case 38: -# line 374 "./dtimep.lex" +# line 384 "./dtimep.lex" ZONED(-1 * 60); break; case 39: -# line 375 "./dtimep.lex" +# line 385 "./dtimep.lex" { tw.tw_zone = 60 * (('a'-1) - LC(*cp)); EXPZONE; @@ -513,7 +523,7 @@ case 39: break; case 40: -# line 379 "./dtimep.lex" +# line 389 "./dtimep.lex" { tw.tw_zone = 60 * ('a' - LC(*cp)); EXPZONE; @@ -521,7 +531,7 @@ case 40: break; case 41: -# line 383 "./dtimep.lex" +# line 393 "./dtimep.lex" { tw.tw_zone = 60 * (LC(*cp) - 'm'); EXPZONE; @@ -529,7 +539,7 @@ case 41: break; case 42: -# line 387 "./dtimep.lex" +# line 397 "./dtimep.lex" { cp++; tw.tw_zone = ((cp[0] * 10 + cp[1]) @@ -545,7 +555,7 @@ case 42: break; case 43: -# line 399 "./dtimep.lex" +# line 409 "./dtimep.lex" { cp++; tw.tw_zone = (('0' * 10 + '0') @@ -561,7 +571,7 @@ case 43: break; case 44: -# line 411 "./dtimep.lex" +# line 421 "./dtimep.lex" { SKIPD; tw.tw_year = CVT4; cp+=4; @@ -569,10 +579,10 @@ case 44: break; case 45: -# line 415 "./dtimep.lex" +# line 425 "./dtimep.lex" case 46: -# line 416 "./dtimep.lex" +# line 426 "./dtimep.lex" ; break; default: return(0); @@ -582,324 +592,324 @@ int yyvstop[] = { 0, 46, -0, +0, 45, -0, +0, 46, -0, +0, 39, -0, +0, 39, -0, +0, 39, -0, +0, 39, -0, +0, 39, -0, +0, 39, -0, +0, 39, -0, +0, 39, -0, +0, 39, -0, +0, 40, -0, +0, 40, -0, +0, 41, -0, +0, 41, -0, +0, 41, -0, +0, 41, -0, +0, 41, -0, +0, 41, -0, +0, 41, -0, +0, 41, -0, +0, 41, -0, +0, 19, -0, +0, 4, -0, +0, 4, -0, +0, 11, -0, +0, 1, -0, +0, 1, -0, +0, 1, -0, +0, 1, -0, +0, 1, -0, +0, 1, -0, +0, 1, -0, +0, 33, -0, +0, 32, -0, +0, 38, -0, +0, 26, -0, +0, 25, -0, +0, 24, -0, +0, 23, -0, +0, 20, -0, +0, 37, -0, +0, 36, -0, +0, 22, -0, +0, 21, -0, +0, 28, -0, +0, 27, -0, +0, 31, -0, +0, 30, -0, +0, 29, -0, +0, 35, -0, +0, 34, -0, +0, 4, -0, +0, 4, -0, +0, 4, -0, +0, 18, -0, +0, 11, -0, +0, 11, -0, +0, 6, -0, +0, 6, -0, +0, 6, -0, +0, 6, -0, +0, 6, -0, +0, 6, -0, +0, 6, -0, +0, 6, -0, +0, 6, -0, +0, 6, -0, +0, 6, -0, +0, 6, -0, +0, 17, 18, -0, +0, 1, -0, +0, 2, -0, +0, 18, -0, +0, 10, -0, +0, 12, -0, +0, 14, -0, +0, 6, -0, +0, 17, 18, -0, +0, 8, -0, +0, 44, -0, +0, 42, -0, +0, 43, -0, +0, 2, -0, +0, 3, -0, +0, 16, -0, +0, 10, -0, +0, 10, -0, +0, 5, -0, +0, 8, -0, +0, 8, -0, +0, 1, -0, +0, 3, -0, +0, 3, -0, +0, 13, -0, +0, 15, -0, +0, 6, -0, +0, 5, -0, +0, 5, -0, +0, 5, -0, +0, 5, -0, +0, 7, -0, +0, 9, -0, +0, 7, -0, +0, 7, -0, +0, 0}; # define YYTYPE int struct yywork { YYTYPE verify, advance; } yycrank[] = { @@ -1668,5 +1678,5 @@ char yyextra[] = { /* The copyright notice above does not evidence any */ /* actual or intended publication of such source code. */ -#pragma ident "@(#)ncform 6.8 95/02/11 SMI" +#pragma ident "@(#)ncform 6.11 97/01/06 SMI"