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).
"19 Jan 00" as the date. The following works around this so
that scan, show, sortm, etc work ok.
"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 <dan-nmh@dilvish.speed.net>
Mon Mar 13 21:32:00 2000 Dan Harkless <dan-nmh@dilvish.speed.net>
for (i = 0; isdigit(*cp); )
i = i*10 + (*cp++ - '0');
tw.tw_year = i;
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 */
-# line 261 "./dtimep.lex"
+# line 271 "./dtimep.lex"
{
tw.tw_mday = CVT1OR2;
while ( ! isalpha( *cp++ ) )
{
tw.tw_mday = CVT1OR2;
while ( ! isalpha( *cp++ ) )
-# line 267 "./dtimep.lex"
+# line 277 "./dtimep.lex"
-# line 276 "./dtimep.lex"
+# line 286 "./dtimep.lex"
-# line 282 "./dtimep.lex"
+# line 292 "./dtimep.lex"
{ /* hack: ctime w/o TZ */
tw.tw_hour = CVT1OR2; cp++;
tw.tw_min = CVT1OR2; cp++;
{ /* hack: ctime w/o TZ */
tw.tw_hour = CVT1OR2; cp++;
tw.tw_min = CVT1OR2; cp++;
-# line 289 "./dtimep.lex"
+# line 299 "./dtimep.lex"
{
tw.tw_hour = CVT1OR2; cp++;
tw.tw_min = CVT1OR2; cp++;
{
tw.tw_hour = CVT1OR2; cp++;
tw.tw_min = CVT1OR2; cp++;
-# line 295 "./dtimep.lex"
+# line 305 "./dtimep.lex"
{
tw.tw_hour = CVT1OR2; cp++;
tw.tw_min = CVT1OR2;
{
tw.tw_hour = CVT1OR2; cp++;
tw.tw_min = CVT1OR2;
-# line 300 "./dtimep.lex"
+# line 310 "./dtimep.lex"
{
tw.tw_hour = CVT1OR2; cp++;
if (tw.tw_hour == 12)
{
tw.tw_hour = CVT1OR2; cp++;
if (tw.tw_hour == 12)
-# line 307 "./dtimep.lex"
+# line 317 "./dtimep.lex"
{
tw.tw_hour = CVT1OR2; cp++;
if (tw.tw_hour == 12)
{
tw.tw_hour = CVT1OR2; cp++;
if (tw.tw_hour == 12)
-# line 315 "./dtimep.lex"
+# line 325 "./dtimep.lex"
{
tw.tw_hour = CVT1OR2; cp++;
if (tw.tw_hour != 12)
{
tw.tw_hour = CVT1OR2; cp++;
if (tw.tw_hour != 12)
-# line 322 "./dtimep.lex"
+# line 332 "./dtimep.lex"
{
tw.tw_hour = CVT1OR2; cp++;
if (tw.tw_hour != 12)
{
tw.tw_hour = CVT1OR2; cp++;
if (tw.tw_hour != 12)
-# line 330 "./dtimep.lex"
+# line 340 "./dtimep.lex"
{
tw.tw_hour = CVT2; cp+=2;
tw.tw_min = CVT2; cp+=2;
{
tw.tw_hour = CVT2; cp+=2;
tw.tw_min = CVT2; cp+=2;
-# line 336 "./dtimep.lex"
+# line 346 "./dtimep.lex"
{
/*
* Luckly, 4 digit times in the range
{
/*
* Luckly, 4 digit times in the range
-# line 344 "./dtimep.lex"
+# line 354 "./dtimep.lex"
{
if (tw.tw_hour || tw.tw_min
|| tw.tw_sec) {
{
if (tw.tw_hour || tw.tw_min
|| tw.tw_sec) {
-# line 355 "./dtimep.lex"
+# line 365 "./dtimep.lex"
ZONE(0 * 60);
break;
case 20:
ZONE(0 * 60);
break;
case 20:
-# line 356 "./dtimep.lex"
+# line 366 "./dtimep.lex"
ZONE(0 * 60);
break;
case 21:
ZONE(0 * 60);
break;
case 21:
-# line 357 "./dtimep.lex"
+# line 367 "./dtimep.lex"
ZONE(2 * 60);
break;
case 22:
ZONE(2 * 60);
break;
case 22:
-# line 358 "./dtimep.lex"
+# line 368 "./dtimep.lex"
ZONED(2 * 60);
break;
case 23:
ZONED(2 * 60);
break;
case 23:
-# line 359 "./dtimep.lex"
+# line 369 "./dtimep.lex"
ZONE(-5 * 60);
break;
case 24:
ZONE(-5 * 60);
break;
case 24:
-# line 360 "./dtimep.lex"
+# line 370 "./dtimep.lex"
ZONED(-5 * 60);
break;
case 25:
ZONED(-5 * 60);
break;
case 25:
-# line 361 "./dtimep.lex"
+# line 371 "./dtimep.lex"
ZONE(-6 * 60);
break;
case 26:
ZONE(-6 * 60);
break;
case 26:
-# line 362 "./dtimep.lex"
+# line 372 "./dtimep.lex"
ZONED(-6 * 60);
break;
case 27:
ZONED(-6 * 60);
break;
case 27:
-# line 363 "./dtimep.lex"
+# line 373 "./dtimep.lex"
ZONE(-7 * 60);
break;
case 28:
ZONE(-7 * 60);
break;
case 28:
-# line 364 "./dtimep.lex"
+# line 374 "./dtimep.lex"
ZONED(-7 * 60);
break;
case 29:
ZONED(-7 * 60);
break;
case 29:
-# line 365 "./dtimep.lex"
+# line 375 "./dtimep.lex"
ZONE(-8 * 60);
break;
case 30:
ZONE(-8 * 60);
break;
case 30:
-# line 366 "./dtimep.lex"
+# line 376 "./dtimep.lex"
ZONED(-8 * 60);
break;
case 31:
ZONED(-8 * 60);
break;
case 31:
-# line 367 "./dtimep.lex"
+# line 377 "./dtimep.lex"
ZONE(-(3 * 60 + 30));
break;
case 32:
ZONE(-(3 * 60 + 30));
break;
case 32:
-# line 368 "./dtimep.lex"
+# line 378 "./dtimep.lex"
ZONE(-4 * 60);
break;
case 33:
ZONE(-4 * 60);
break;
case 33:
-# line 369 "./dtimep.lex"
+# line 379 "./dtimep.lex"
ZONED(-4 * 60);
break;
case 34:
ZONED(-4 * 60);
break;
case 34:
-# line 370 "./dtimep.lex"
+# line 380 "./dtimep.lex"
ZONE(-9 * 60);
break;
case 35:
ZONE(-9 * 60);
break;
case 35:
-# line 371 "./dtimep.lex"
+# line 381 "./dtimep.lex"
ZONED(-9 * 60);
break;
case 36:
ZONED(-9 * 60);
break;
case 36:
-# line 372 "./dtimep.lex"
+# line 382 "./dtimep.lex"
ZONE(-10 * 60);
break;
case 37:
ZONE(-10 * 60);
break;
case 37:
-# line 373 "./dtimep.lex"
+# line 383 "./dtimep.lex"
ZONED(-10 * 60);
break;
case 38:
ZONED(-10 * 60);
break;
case 38:
-# line 374 "./dtimep.lex"
+# line 384 "./dtimep.lex"
ZONED(-1 * 60);
break;
case 39:
ZONED(-1 * 60);
break;
case 39:
-# line 375 "./dtimep.lex"
+# line 385 "./dtimep.lex"
{
tw.tw_zone = 60 * (('a'-1) - LC(*cp));
EXPZONE;
{
tw.tw_zone = 60 * (('a'-1) - LC(*cp));
EXPZONE;
-# line 379 "./dtimep.lex"
+# line 389 "./dtimep.lex"
{
tw.tw_zone = 60 * ('a' - LC(*cp));
EXPZONE;
{
tw.tw_zone = 60 * ('a' - LC(*cp));
EXPZONE;
-# line 383 "./dtimep.lex"
+# line 393 "./dtimep.lex"
{
tw.tw_zone = 60 * (LC(*cp) - 'm');
EXPZONE;
{
tw.tw_zone = 60 * (LC(*cp) - 'm');
EXPZONE;
-# line 387 "./dtimep.lex"
+# line 397 "./dtimep.lex"
{
cp++;
tw.tw_zone = ((cp[0] * 10 + cp[1])
{
cp++;
tw.tw_zone = ((cp[0] * 10 + cp[1])
-# line 399 "./dtimep.lex"
+# line 409 "./dtimep.lex"
{
cp++;
tw.tw_zone = (('0' * 10 + '0')
{
cp++;
tw.tw_zone = (('0' * 10 + '0')
-# line 411 "./dtimep.lex"
+# line 421 "./dtimep.lex"
{
SKIPD;
tw.tw_year = CVT4; cp+=4;
{
SKIPD;
tw.tw_year = CVT4; cp+=4;
-# line 415 "./dtimep.lex"
+# line 425 "./dtimep.lex"
-# line 416 "./dtimep.lex"
+# line 426 "./dtimep.lex"
;
break;
default: return(0);
;
break;
default: return(0);
0};
# define YYTYPE int
struct yywork { YYTYPE verify, advance; } yycrank[] = {
0};
# define YYTYPE int
struct yywork { YYTYPE verify, advance; } yycrank[] = {
/* The copyright notice above does not evidence any */
/* actual or intended publication of such source code. */
/* 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"