Xkw/Imakefile: (PORT) Use "$(LEX)" instead of hard-coding "lex". Xkw/laylex.l: (PORT) Support for flex. xmille/drawcard.c: (BUG) (init_cards): Fix a missing assignment to gc. xmille/save.c: (BUG, or maybe TWEAK) If there's an error picking the file name to save in or trying to create the file, then retry instead of returning immediately. xmille/misc.c: (BUG, or maybe TWEAK) Don't keep going if the user aborts a save when he's already asked to quit. --- ./Xkw/Imakefile 1995/10/25 14:08:33 1.1 +++ ./Xkw/Imakefile 1995/10/25 14:08:37 @@ -32,7 +32,7 @@ -rm laygram.c laygram.h laylex.c: laylex.l - lex laylex.l + $(LEX) laylex.l sed 's/yy/LayYY/g' lex.yy.c > laylex.c rm lex.yy.c --- ./Xkw/laylex.l 1995/10/25 14:16:58 1.1 +++ ./Xkw/laylex.l 1995/10/25 14:24:10 @@ -1,6 +1,8 @@ %{ +#ifndef FLEX_SCANNER #undef input #undef unput +#endif #include #include @@ -12,8 +14,26 @@ #include "laygram.h" static char *yysourcebase, *yysource; +#ifdef FLEX_SCANNER + +#define YY_INPUT(buf,result,max_size) { \ + int c = *yysource++; \ + if ((c == EOF) || (c == '\0')) { \ + /* Not sure checking for NULL is correct, but it probably is. */ \ + result = YY_NULL; \ + } \ + else { \ + buf[0] = c; \ + result = 1; \ + } \ +} + +#else /* ! FLEX_SCANNER */ + #define input() (*yysource++) #define unput(c) (--yysource) + +#endif /* FLEX_SCANNER */ %} %% --- ./xmille/drawcard.c 1995/10/25 16:41:39 1.1 +++ ./xmille/drawcard.c 1995/10/25 16:41:43 @@ -235,7 +235,7 @@ init_card (&deck, back_gc); gc_values.font = backFont->fid; gc_values.foreground = colorMap[RED_COLOR].pixel; - XCreateGC (dpy, deck.bits, GCFont|GCForeground, &gc_values); + gc = XCreateGC (dpy, deck.bits, GCFont|GCForeground, &gc_values); center_text (deck.bits, gc, backFont, HEIGHT / 2 - backFont->descent, "Mille"); XSetForeground (dpy, gc, colorMap[BLUE_COLOR].pixel); --- ./xmille/save.c 1995/10/25 16:52:31 1.1 +++ ./xmille/save.c 1995/10/25 16:57:44 @@ -52,11 +52,11 @@ if (sp == buf || (!Fromfile && stat(buf, &junk) > -1 && getyn("Overwrite File? ") == FALSE)) - return FALSE; + goto over; if ((outf = creat(buf, 0644)) < 0) { error(sys_errlist[errno]); - return FALSE; + goto over; } Error (buf); time(tp); /* get current time */ --- ./xmille/misc.c 1995/10/25 16:58:18 1.1 +++ ./xmille/misc.c 1995/10/25 16:58:20 @@ -98,7 +98,6 @@ if (getyn("Another hand? ")) return; if (!Saved && getyn("Save game? ")) - if (!save()) - return; + save(); die(); }