ambiguous comments preceding day_map[] array (from old dtimep.lex) that probably
led to the erroneous cp++ being added.
+Thu Jun 08 19:36:57 2000 Dan Harkless <dan-nmh@dilvish.speed.net>
+
+ * New dtimep.lex didn't parse day names properly. Fixed. Also
+ clarified ambiguous comments preceding day_map[] array (from old
+ dtimep.lex) that probably led to the erroneous cp++ being added.
+
Wed Jun 7 20:52:33 CEST 2000 Ruud de Rooij <ruud@ruud.org>
* Added one more mkstemp invocation to uip/spost.c (which was in a
Wed May 31 07:40:45 2000 Doug Morris <doug@mhost.com>
- * added a lint target to the Makefiles and a check in autoconf
+ * Added a lint target to the Makefiles and a check in autoconf
to determine whether lint or lclint exists on the system.
Fri May 30 19:21:48 2000 Dan Harkless <dan-nmh@dilvish.speed.net>
tws.h to h/). Updated all source files to reflect to new location
of tws.h.
- * Rewrote dparsetime (dtimep.c) to replace the old
- zotnet/tws/dtimep.c, lexstring.c, lexedit.c, and
- dtimep.c-lexed. It should now work with flex (although untested
- with lex), and requires no sed-ing. For now, I have the lexed
- version in the distribution, so that end-users don't need to worry
- about running it through flex/lex. I have not added back support
- for guessing the time zone when it's not specified.
+ * Rewrote dparsetime (in dtimep.lex -> dtimep.c) to replace the
+ old zotnet/tws/dtimep.c, dtimep.lex, lexstring.c, lexedit.c, and
+ dtimep.c-lexed. It should now work with flex (although untested
+ with lex), and requires no sed-ing. For now, I have the lexed
+ version in the distribution, so that end-users don't need to worry
+ about running it through flex/lex. I have not added back support
+ for guessing the time zone when it's not specified.
Sun May 28 17:44:15 CEST 2000 Ruud de Rooij <ruud@ruud.org>
};
/*
- * Same trick for day-of-week using the hash function
- * (c1 & 7) + (c2 & 4)
+ * Lookup table for day-of-week using the same hash trick as for above name-of-
+ * month table, but using the first and second character, not second and third.
+ *
+ * Compute index into table using: (day_name[0] & 7) + (day_name[1] & 4)
*/
static int day_map[] = {
0,
*/
#define INIT() { cp = yytext;}
-#define SETWDAY() { cp++; \
- tw.tw_wday= day_map[(cp[0] & 7) + (cp[1] & 4)]; \
+#define SETWDAY() { tw.tw_wday= day_map[(cp[0] & 7) + (cp[1] & 4)]; \
tw.tw_flags &= ~TW_SDAY; tw.tw_flags |= TW_SEXP; \
SKIPA(); }
#define SETMON() { cp++; \
register char *yy_cp, *yy_bp;
register int yy_act;
-#line 197 "dtimep.lex"
+#line 198 "dtimep.lex"
/* This section begins the definition of dparsetime().
case 1:
YY_RULE_SETUP
-#line 212 "dtimep.lex"
+#line 213 "dtimep.lex"
{
INIT();
SETWDAY();
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 225 "dtimep.lex"
+#line 226 "dtimep.lex"
{
INIT();
SETWDAY();
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 237 "dtimep.lex"
+#line 238 "dtimep.lex"
{
INIT();
SETDAY();
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 247 "dtimep.lex"
+#line 248 "dtimep.lex"
{
INIT();
SETWDAY();
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 259 "dtimep.lex"
+#line 260 "dtimep.lex"
{
INIT();
SETWDAY();
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 269 "dtimep.lex"
+#line 270 "dtimep.lex"
{
INIT();
SETMON();
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 279 "dtimep.lex"
+#line 280 "dtimep.lex"
{
INIT();
SETMON();
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 287 "dtimep.lex"
+#line 288 "dtimep.lex"
{
INIT();
if(europeandate) {
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 305 "dtimep.lex"
+#line 306 "dtimep.lex"
{
INIT();
if(europeandate) {
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 322 "dtimep.lex"
+#line 323 "dtimep.lex"
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 323 "dtimep.lex"
+#line 324 "dtimep.lex"
tw.tw_hour += 12;
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 325 "dtimep.lex"
+#line 326 "dtimep.lex"
{
INIT();
SKIPTOD();
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 330 "dtimep.lex"
+#line 331 "dtimep.lex"
{
INIT();
SKIPTOD();
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 335 "dtimep.lex"
+#line 336 "dtimep.lex"
INIT(); SETZONE(0);
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 336 "dtimep.lex"
+#line 337 "dtimep.lex"
INIT(); SETZONE(0);
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 337 "dtimep.lex"
+#line 338 "dtimep.lex"
INIT(); SETZONE(200);
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 338 "dtimep.lex"
+#line 339 "dtimep.lex"
INIT(); SETDST(); SETZONE(2);
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 339 "dtimep.lex"
+#line 340 "dtimep.lex"
INIT(); SETZONE(-500);
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 340 "dtimep.lex"
+#line 341 "dtimep.lex"
INIT(); SETDST(); SETZONE(-500);
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 341 "dtimep.lex"
+#line 342 "dtimep.lex"
INIT(); SETZONE(-600);
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 342 "dtimep.lex"
+#line 343 "dtimep.lex"
INIT(); SETDST(); SETZONE(-600);
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 343 "dtimep.lex"
+#line 344 "dtimep.lex"
INIT(); SETZONE(-700);
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 344 "dtimep.lex"
+#line 345 "dtimep.lex"
INIT(); SETDST(); SETZONE(-700);
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 345 "dtimep.lex"
+#line 346 "dtimep.lex"
INIT(); SETZONE(-800);
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 346 "dtimep.lex"
+#line 347 "dtimep.lex"
INIT(); SETDST(); SETZONE(-800);
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 347 "dtimep.lex"
+#line 348 "dtimep.lex"
INIT(); SETZONE(-330);
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 348 "dtimep.lex"
+#line 349 "dtimep.lex"
INIT(); SETZONE(-400);
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 349 "dtimep.lex"
+#line 350 "dtimep.lex"
INIT(); SETDST(); SETZONE(-400);
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 350 "dtimep.lex"
+#line 351 "dtimep.lex"
INIT(); SETZONE(-900);
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 351 "dtimep.lex"
+#line 352 "dtimep.lex"
INIT(); SETDST(); SETZONE(-900);
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 352 "dtimep.lex"
+#line 353 "dtimep.lex"
INIT(); SETZONE(-1000);
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 353 "dtimep.lex"
+#line 354 "dtimep.lex"
INIT(); SETDST(); SETZONE(-1000);
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 354 "dtimep.lex"
+#line 355 "dtimep.lex"
INIT(); SETDST(); SETZONE(-100);
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 355 "dtimep.lex"
+#line 356 "dtimep.lex"
{
INIT();
SETZONE(100*(('a'-1) - tolower(*cp)));
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 359 "dtimep.lex"
+#line 360 "dtimep.lex"
{
INIT();
SETZONE(100*('a' - tolower(*cp)));
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 363 "dtimep.lex"
+#line 364 "dtimep.lex"
{
INIT();
SETZONE(100*(tolower(*cp) - 'm'));
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 367 "dtimep.lex"
+#line 368 "dtimep.lex"
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 368 "dtimep.lex"
+#line 369 "dtimep.lex"
ECHO;
YY_BREAK
case YY_STATE_EOF(INITIAL):
return 0;
}
#endif
-#line 368 "dtimep.lex"
+#line 369 "dtimep.lex"
};
/*
- * Same trick for day-of-week using the hash function
- * (c1 & 7) + (c2 & 4)
+ * Lookup table for day-of-week using the same hash trick as for above name-of-
+ * month table, but using the first and second character, not second and third.
+ *
+ * Compute index into table using: (day_name[0] & 7) + (day_name[1] & 4)
*/
static int day_map[] = {
0,
*/
#define INIT() { cp = yytext;}
-#define SETWDAY() { cp++; \
- tw.tw_wday= day_map[(cp[0] & 7) + (cp[1] & 4)]; \
+#define SETWDAY() { tw.tw_wday= day_map[(cp[0] & 7) + (cp[1] & 4)]; \
tw.tw_flags &= ~TW_SDAY; tw.tw_flags |= TW_SEXP; \
SKIPA(); }
#define SETMON() { cp++; \