chiark / gitweb /
debian/control: Add missing build-dependency on flex. Fixes FTBFS. Report from Aurel...
[userv.git] / lexer.l
diff --git a/lexer.l b/lexer.l
index 5b98073c2b8cc88f697680784c60afcf8566cdfb..d498bad8bc6a2ca2e68185971c93e55575533aa2 100644 (file)
--- a/lexer.l
+++ b/lexer.l
@@ -1,19 +1,19 @@
 /*
- *   Copyright (C)1996-1997,1999 Ian Jackson
- *  
- *   This is free software; you can redistribute it and/or modify it
- *   under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *  
- *   This program is distributed in the hope that it will be useful, but
- *   WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *   General Public License for more details.
- *  
- *   You should have received a copy of the GNU General Public License
- *   along with userv; if not, write to the Free Software
- *   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * userv is copyright Ian Jackson and other contributors.
+ * See README for full authorship information.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with userv; if not, see <http://www.gnu.org/licenses/>.
  */
 
 %{
@@ -52,7 +52,7 @@ typedef int directive_fnt(int dtoken);
 static directive_fnt df_reject, df_execute, df_executefrompath;
 static directive_fnt df_executefromdirectory, df_executebuiltin;
 static directive_fnt df_errorstostderr, df_errorstosyslog, df_errorstofile;
-static directive_fnt dfg_fdwant, dfg_setflag;
+static directive_fnt dfg_fdwant, dfg_setflag, dfg_lookupquotemode;
 static directive_fnt df_reset, df_cd, df_userrcfile, df_include;
 static directive_fnt df_includelookup, df_includedirectory;
 static directive_fnt df_message, df_error, df_quit, df_eof;
@@ -135,11 +135,12 @@ 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
+#define YY_NO_INPUT
 
 %}
 
 %option noyywrap
+%option nounput
 
 %%
 
@@ -150,6 +151,8 @@ execute-builtin { lr_dir= df_executebuiltin; return tokv_word_executebuiltin; }
 errors-to-stderr { lr_dir= df_errorstostderr; return tokv_word_errorstostderr; }
 errors-to-syslog { lr_dir= df_errorstosyslog; return tokv_word_errorstosyslog; }
 errors-to-file { lr_dir= df_errorstofile; return tokv_word_errorstofile; }
+include-lookup-quote-old { lr_dir= dfg_lookupquotemode; return tokv_word_includelookupquoteold; }
+include-lookup-quote-new { lr_dir= dfg_lookupquotemode; return tokv_word_includelookupquotenew; }
 require-fd { lr_dir= dfg_fdwant; lr_fdwant_readwrite=1; return tokv_word_requirefd; }
 allow-fd { lr_dir= dfg_fdwant; lr_fdwant_readwrite=0; return tokv_word_allowfd; }
 null-fd { lr_dir= dfg_fdwant; lr_fdwant_readwrite=0; return tokv_word_nullfd; }
@@ -230,6 +233,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 +255,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 +266,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;
                        }