=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/bc/scan.l,v retrieving revision 1.20 retrieving revision 1.21 diff -c -r1.20 -r1.21 *** src/usr.bin/bc/scan.l 2006/01/24 19:38:44 1.20 --- src/usr.bin/bc/scan.l 2006/03/18 20:44:43 1.21 *************** *** 1,5 **** %{ ! /* $OpenBSD: scan.l,v 1.20 2006/01/24 19:38:44 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek --- 1,5 ---- %{ ! /* $OpenBSD: scan.l,v 1.21 2006/03/18 20:44:43 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek *************** *** 18,24 **** */ #ifndef lint ! static const char rcsid[] = "$OpenBSD: scan.l,v 1.20 2006/01/24 19:38:44 otto Exp $"; #endif /* not lint */ #include --- 18,24 ---- */ #ifndef lint ! static const char rcsid[] = "$OpenBSD: scan.l,v 1.21 2006/03/18 20:44:43 otto Exp $"; #endif /* not lint */ #include *************** *** 32,42 **** #include "y.tab.h" int lineno; static char *strbuf = NULL; static size_t strbuf_sz = 1; static bool dot_seen; - static volatile sig_atomic_t interactive = 0; static void init_strbuf(void); static void add_str(const char *); --- 32,42 ---- #include "y.tab.h" int lineno; + bool interactive; static char *strbuf = NULL; static size_t strbuf_sz = 1; static bool dot_seen; static void init_strbuf(void); static void add_str(const char *); *************** *** 232,243 **** const char str[] = "[\n]P\n"; int save_errno; ! if (interactive) { ! save_errno = errno; ! YY_FLUSH_BUFFER; /* XXX signal race? */ ! write(STDOUT_FILENO, str, sizeof(str) - 1); ! errno = save_errno; ! } } int --- 232,241 ---- const char str[] = "[\n]P\n"; int save_errno; ! save_errno = errno; ! YY_FLUSH_BUFFER; /* XXX signal race? */ ! write(STDOUT_FILENO, str, sizeof(str) - 1); ! errno = save_errno; } int *************** *** 277,283 **** } else if (fileindex == sargc) { fileindex++; yyin = stdin; ! interactive = isatty(fileno(yyin)); lineno = 1; filename = "stdin"; return (0); --- 275,282 ---- } else if (fileindex == sargc) { fileindex++; yyin = stdin; ! if (interactive) ! signal(SIGINT, abort_line); lineno = 1; filename = "stdin"; return (0);