summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-01-05 18:26:24 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-01-05 18:26:24 +0000
commitcad70aa8372e8d3ed3f8e63172382664bcbf3046 (patch)
tree0c8be7f0fb07349f4e60b91f5950c73e8054a021 /usr.bin
parent1d5d1c924047fe9416f187175aacd6da048933de (diff)
Restore errno in yy_init_buffer() since it may get trounced by the
call to isatty(). Fixes PR #1606.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/lex/flex.skl8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/lex/flex.skl b/usr.bin/lex/flex.skl
index afcfd0847b6..126db4f55ee 100644
--- a/usr.bin/lex/flex.skl
+++ b/usr.bin/lex/flex.skl
@@ -1,9 +1,9 @@
-/* $OpenBSD: flex.skl,v 1.5 1997/07/25 21:05:28 mickey Exp $ */
+/* $OpenBSD: flex.skl,v 1.6 2001/01/05 18:26:23 millert Exp $ */
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
- * $Header: /cvs/OpenBSD/src/usr.bin/lex/flex.skl,v 1.5 1997/07/25 21:05:28 mickey Exp $
+ * $Header: /cvs/OpenBSD/src/usr.bin/lex/flex.skl,v 1.6 2001/01/05 18:26:23 millert Exp $
*/
#define FLEX_SCANNER
@@ -12,6 +12,7 @@
%-
#include <stdio.h>
+#include <errno.h>
%*
@@ -1199,6 +1200,8 @@ void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, istream* file )
%*
{
+ int oerrno = errno;
+
yy_flush_buffer( b );
b->yy_input_file = file;
@@ -1217,6 +1220,7 @@ void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, istream* file )
%+
b->yy_is_interactive = 0;
%*
+ errno = oerrno;
}