chiark / gitweb /
Update some copyright notices.
[userv.git] / lexer.l
diff --git a/lexer.l b/lexer.l
index 5b98073c2b8cc88f697680784c60afcf8566cdfb..c3b45b7a8636a65d310132f55747c5fc900e2c72 100644 (file)
--- a/lexer.l
+++ b/lexer.l
@@ -135,11 +135,10 @@ static struct error_handling eh = { tokv_word_errorstostderr, 0,0,0,0,0 };
 static int dequote(char *inplace);
 static void countnewlines(void);
 
-#define YY_NO_UNPUT
-
 %}
 
 %option noyywrap
+%option nounput
 
 %%
 
@@ -230,6 +229,9 @@ local7 { lr_logfacility= LOG_LOCAL7; return tokv_syslog_local7; }
 read { return tokv_word_read; }
 write { return tokv_word_write; }
 \$ { return tokv_dollar; }
+stdin {  lr_max= lr_min= 0; return tokv_word_stdin; }
+stdout {  lr_max= lr_min= 1; return tokv_word_stdout; }
+stderr {  lr_max= lr_min= 2; return tokv_word_stderr; }
 \( { return tokv_openparen; }
 \) { return tokv_closeparen; }
 \! { return tokv_not; }
@@ -249,7 +251,7 @@ error { lr_dir= df_error; lr_loglevel= LOG_ERR; return tokv_word_error; }
                          char *ep;
                          lr_min= (int)strtoul(yytext,&ep,10);
                          assert(*ep == HYPHEN);
-                         assert(*++ep);
+                         ep++;  assert(*ep);
                          lr_max= (int)strtoul(ep,&ep,10);
                          assert(!*ep);
                          if (lr_max < lr_min)
@@ -260,7 +262,7 @@ error { lr_dir= df_error; lr_loglevel= LOG_ERR; return tokv_word_error; }
                          char *ep;
                          lr_min= (int)strtoul(yytext,&ep,10);
                          assert(*ep == HYPHEN);
-                         assert(!*++ep);
+                         ep++;  assert(!*ep);
                          lr_max=-1;
                          return tokv_fdstoend;
                        }