summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Pfatschbacher <mpf@cvs.openbsd.org>2007-11-12 23:59:42 +0000
committerMarco Pfatschbacher <mpf@cvs.openbsd.org>2007-11-12 23:59:42 +0000
commitaa82c35307ac93f9f8516d4168a7cb0e7eaf56c4 (patch)
tree4c64e3b6fb9c0de041ee36807ace3f83cca007f0
parenteb8064cb59bbaeb4315946b2f188364a7061bd29 (diff)
Remove space/tab compression function from lgetc() and replace
it with a simple filter in the yylex() loop. The compression in lgetc() didn't happen for quoted strings, thus creating a regression when tabs were used in variables. Some testing by todd@ and pyr@ OK deraadt@
-rw-r--r--bin/chio/parse.y12
-rw-r--r--sbin/ipsecctl/parse.y12
-rw-r--r--sbin/pfctl/parse.y12
-rw-r--r--usr.sbin/bgpd/parse.y12
-rw-r--r--usr.sbin/dvmrpd/parse.y12
-rw-r--r--usr.sbin/hostapd/parse.y12
-rw-r--r--usr.sbin/hoststated/parse.y12
-rw-r--r--usr.sbin/ifstated/parse.y12
-rw-r--r--usr.sbin/ntpd/parse.y12
-rw-r--r--usr.sbin/ospf6d/parse.y12
-rw-r--r--usr.sbin/ospfd/parse.y12
-rw-r--r--usr.sbin/relayd/parse.y12
-rw-r--r--usr.sbin/ripd/parse.y12
13 files changed, 26 insertions, 130 deletions
diff --git a/bin/chio/parse.y b/bin/chio/parse.y
index 981962a452b..b78e9f26906 100644
--- a/bin/chio/parse.y
+++ b/bin/chio/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.10 2007/10/16 20:01:23 mpf Exp $ */
+/* $OpenBSD: parse.y,v 1.11 2007/11/12 23:59:40 mpf Exp $ */
/*
* Copyright (c) 2006 Bob Beck <beck@openbsd.org>
@@ -217,14 +217,6 @@ lgetc(int quotec)
yylval.lineno = file->lineno;
file->lineno++;
}
- if (c == '\t' || c == ' ') {
- /* Compress blanks to a single space. */
- do {
- c = getc(file->stream);
- } while (c == '\t' || c == ' ');
- ungetc(c, file->stream);
- c = ' ';
- }
while (c == EOF) {
if (popfile() == EOF)
@@ -280,7 +272,7 @@ yylex(void)
int token;
p = buf;
- while ((c = lgetc(0)) == ' ')
+ while ((c = lgetc(0)) == ' ' || c == '\t')
; /* nothing */
yylval.lineno = file->lineno;
diff --git a/sbin/ipsecctl/parse.y b/sbin/ipsecctl/parse.y
index c826fa21686..a9bfec5bf17 100644
--- a/sbin/ipsecctl/parse.y
+++ b/sbin/ipsecctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.131 2007/10/22 16:35:33 pyr Exp $ */
+/* $OpenBSD: parse.y,v 1.132 2007/11/12 23:59:41 mpf Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -959,14 +959,6 @@ lgetc(int quotec)
yylval.lineno = file->lineno;
file->lineno++;
}
- if (c == '\t' || c == ' ') {
- /* Compress blanks to a single space. */
- do {
- c = getc(file->stream);
- } while (c == '\t' || c == ' ');
- ungetc(c, file->stream);
- c = ' ';
- }
while (c == EOF) {
if (popfile() == EOF)
@@ -1023,7 +1015,7 @@ yylex(void)
top:
p = buf;
- while ((c = lgetc(0)) == ' ')
+ while ((c = lgetc(0)) == ' ' || c == '\t')
; /* nothing */
yylval.lineno = file->lineno;
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index dddd199d80f..362c1e0969a 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.533 2007/10/25 21:36:21 mpf Exp $ */
+/* $OpenBSD: parse.y,v 1.534 2007/11/12 23:59:41 mpf Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -5228,14 +5228,6 @@ lgetc(int quotec)
yylval.lineno = file->lineno;
file->lineno++;
}
- if (c == '\t' || c == ' ') {
- /* Compress blanks to a single space. */
- do {
- c = getc(file->stream);
- } while (c == '\t' || c == ' ');
- ungetc(c, file->stream);
- c = ' ';
- }
while (c == EOF) {
if (popfile() == EOF)
@@ -5292,7 +5284,7 @@ yylex(void)
top:
p = buf;
- while ((c = lgetc(0)) == ' ')
+ while ((c = lgetc(0)) == ' ' || c == '\t')
; /* nothing */
yylval.lineno = file->lineno;
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index 5bb5eea3c13..a7f912e07f4 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.213 2007/10/20 14:24:02 pyr Exp $ */
+/* $OpenBSD: parse.y,v 1.214 2007/11/12 23:59:41 mpf Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1901,14 +1901,6 @@ lgetc(int quotec)
yylval.lineno = file->lineno;
file->lineno++;
}
- if (c == '\t' || c == ' ') {
- /* Compress blanks to a single space. */
- do {
- c = getc(file->stream);
- } while (c == '\t' || c == ' ');
- ungetc(c, file->stream);
- c = ' ';
- }
while (c == EOF) {
if (popfile() == EOF)
@@ -1965,7 +1957,7 @@ yylex(void)
top:
p = buf;
- while ((c = lgetc(0)) == ' ')
+ while ((c = lgetc(0)) == ' ' || c == '\t')
; /* nothing */
yylval.lineno = file->lineno;
diff --git a/usr.sbin/dvmrpd/parse.y b/usr.sbin/dvmrpd/parse.y
index 5a25d8a24fc..9e8941ddf35 100644
--- a/usr.sbin/dvmrpd/parse.y
+++ b/usr.sbin/dvmrpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.12 2007/10/20 13:26:50 pyr Exp $ */
+/* $OpenBSD: parse.y,v 1.13 2007/11/12 23:59:41 mpf Exp $ */
/*
* Copyright (c) 2004, 2005, 2006 Esben Norby <norby@openbsd.org>
@@ -447,14 +447,6 @@ lgetc(int quotec)
yylval.lineno = file->lineno;
file->lineno++;
}
- if (c == '\t' || c == ' ') {
- /* Compress blanks to a single space. */
- do {
- c = getc(file->stream);
- } while (c == '\t' || c == ' ');
- ungetc(c, file->stream);
- c = ' ';
- }
while (c == EOF) {
if (popfile() == EOF)
@@ -511,7 +503,7 @@ yylex(void)
top:
p = buf;
- while ((c = lgetc(0)) == ' ')
+ while ((c = lgetc(0)) == ' ' || c == '\t')
; /* nothing */
yylval.lineno = file->lineno;
diff --git a/usr.sbin/hostapd/parse.y b/usr.sbin/hostapd/parse.y
index e2a7170e788..4f4103cd656 100644
--- a/usr.sbin/hostapd/parse.y
+++ b/usr.sbin/hostapd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.35 2007/10/22 16:56:13 pyr Exp $ */
+/* $OpenBSD: parse.y,v 1.36 2007/11/12 23:59:41 mpf Exp $ */
/*
* Copyright (c) 2004, 2005, 2006 Reyk Floeter <reyk@openbsd.org>
@@ -1368,14 +1368,6 @@ lgetc(int quotec)
yylval.lineno = file->lineno;
file->lineno++;
}
- if (c == '\t' || c == ' ') {
- /* Compress blanks to a single space. */
- do {
- c = getc(file->stream);
- } while (c == '\t' || c == ' ');
- ungetc(c, file->stream);
- c = ' ';
- }
while (c == EOF) {
if (popfile() == EOF)
@@ -1432,7 +1424,7 @@ yylex(void)
top:
p = buf;
- while ((c = lgetc(0)) == ' ')
+ while ((c = lgetc(0)) == ' ' || c == '\t')
; /* nothing */
yylval.lineno = file->lineno;
diff --git a/usr.sbin/hoststated/parse.y b/usr.sbin/hoststated/parse.y
index d019a4449ee..0f79c9f52bd 100644
--- a/usr.sbin/hoststated/parse.y
+++ b/usr.sbin/hoststated/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.76 2007/11/04 18:47:17 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.77 2007/11/12 23:59:41 mpf Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -1324,14 +1324,6 @@ lgetc(int quotec)
yylval.lineno = file->lineno;
file->lineno++;
}
- if (c == '\t' || c == ' ') {
- /* Compress blanks to a single space. */
- do {
- c = getc(file->stream);
- } while (c == '\t' || c == ' ');
- ungetc(c, file->stream);
- c = ' ';
- }
while (c == EOF) {
if (popfile() == EOF)
@@ -1388,7 +1380,7 @@ yylex(void)
top:
p = buf;
- while ((c = lgetc(0)) == ' ')
+ while ((c = lgetc(0)) == ' ' || c == '\t')
; /* nothing */
yylval.lineno = file->lineno;
diff --git a/usr.sbin/ifstated/parse.y b/usr.sbin/ifstated/parse.y
index 5f54814dff2..e13e642d9c1 100644
--- a/usr.sbin/ifstated/parse.y
+++ b/usr.sbin/ifstated/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.24 2007/10/25 06:03:31 pyr Exp $ */
+/* $OpenBSD: parse.y,v 1.25 2007/11/12 23:59:41 mpf Exp $ */
/*
* Copyright (c) 2004 Ryan McBride <mcbride@openbsd.org>
@@ -448,14 +448,6 @@ lgetc(int quotec)
yylval.lineno = file->lineno;
file->lineno++;
}
- if (c == '\t' || c == ' ') {
- /* Compress blanks to a single space. */
- do {
- c = getc(file->stream);
- } while (c == '\t' || c == ' ');
- ungetc(c, file->stream);
- c = ' ';
- }
while (c == EOF) {
if (popfile() == EOF)
@@ -512,7 +504,7 @@ yylex(void)
top:
p = buf;
- while ((c = lgetc(0)) == ' ')
+ while ((c = lgetc(0)) == ' ' || c == '\t')
; /* nothing */
yylval.lineno = file->lineno;
diff --git a/usr.sbin/ntpd/parse.y b/usr.sbin/ntpd/parse.y
index 59705c80a10..082e0c3f7e4 100644
--- a/usr.sbin/ntpd/parse.y
+++ b/usr.sbin/ntpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.40 2007/10/20 14:24:02 pyr Exp $ */
+/* $OpenBSD: parse.y,v 1.41 2007/11/12 23:59:41 mpf Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -370,14 +370,6 @@ lgetc(int quotec)
yylval.lineno = file->lineno;
file->lineno++;
}
- if (c == '\t' || c == ' ') {
- /* Compress blanks to a single space. */
- do {
- c = getc(file->stream);
- } while (c == '\t' || c == ' ');
- ungetc(c, file->stream);
- c = ' ';
- }
while (c == EOF) {
if (popfile() == EOF)
@@ -433,7 +425,7 @@ yylex(void)
int token;
p = buf;
- while ((c = lgetc(0)) == ' ')
+ while ((c = lgetc(0)) == ' ' || c == '\t')
; /* nothing */
yylval.lineno = file->lineno;
diff --git a/usr.sbin/ospf6d/parse.y b/usr.sbin/ospf6d/parse.y
index c2ce0df8aa9..5235bf2821e 100644
--- a/usr.sbin/ospf6d/parse.y
+++ b/usr.sbin/ospf6d/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.10 2007/10/20 13:26:50 pyr Exp $ */
+/* $OpenBSD: parse.y,v 1.11 2007/11/12 23:59:41 mpf Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -612,14 +612,6 @@ lgetc(int quotec)
yylval.lineno = file->lineno;
file->lineno++;
}
- if (c == '\t' || c == ' ') {
- /* Compress blanks to a single space. */
- do {
- c = getc(file->stream);
- } while (c == '\t' || c == ' ');
- ungetc(c, file->stream);
- c = ' ';
- }
while (c == EOF) {
if (popfile() == EOF)
@@ -676,7 +668,7 @@ yylex(void)
top:
p = buf;
- while ((c = lgetc(0)) == ' ')
+ while ((c = lgetc(0)) == ' ' || c == '\t')
; /* nothing */
yylval.lineno = file->lineno;
diff --git a/usr.sbin/ospfd/parse.y b/usr.sbin/ospfd/parse.y
index c5a8b82b7e4..8d0f0f42ff9 100644
--- a/usr.sbin/ospfd/parse.y
+++ b/usr.sbin/ospfd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.58 2007/10/20 13:29:44 pyr Exp $ */
+/* $OpenBSD: parse.y,v 1.59 2007/11/12 23:59:41 mpf Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -733,14 +733,6 @@ lgetc(int quotec)
yylval.lineno = file->lineno;
file->lineno++;
}
- if (c == '\t' || c == ' ') {
- /* Compress blanks to a single space. */
- do {
- c = getc(file->stream);
- } while (c == '\t' || c == ' ');
- ungetc(c, file->stream);
- c = ' ';
- }
while (c == EOF) {
if (popfile() == EOF)
@@ -797,7 +789,7 @@ yylex(void)
top:
p = buf;
- while ((c = lgetc(0)) == ' ')
+ while ((c = lgetc(0)) == ' ' || c == '\t')
; /* nothing */
yylval.lineno = file->lineno;
diff --git a/usr.sbin/relayd/parse.y b/usr.sbin/relayd/parse.y
index d019a4449ee..0f79c9f52bd 100644
--- a/usr.sbin/relayd/parse.y
+++ b/usr.sbin/relayd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.76 2007/11/04 18:47:17 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.77 2007/11/12 23:59:41 mpf Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -1324,14 +1324,6 @@ lgetc(int quotec)
yylval.lineno = file->lineno;
file->lineno++;
}
- if (c == '\t' || c == ' ') {
- /* Compress blanks to a single space. */
- do {
- c = getc(file->stream);
- } while (c == '\t' || c == ' ');
- ungetc(c, file->stream);
- c = ' ';
- }
while (c == EOF) {
if (popfile() == EOF)
@@ -1388,7 +1380,7 @@ yylex(void)
top:
p = buf;
- while ((c = lgetc(0)) == ' ')
+ while ((c = lgetc(0)) == ' ' || c == '\t')
; /* nothing */
yylval.lineno = file->lineno;
diff --git a/usr.sbin/ripd/parse.y b/usr.sbin/ripd/parse.y
index aac7f8b448e..58416c55810 100644
--- a/usr.sbin/ripd/parse.y
+++ b/usr.sbin/ripd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.16 2007/10/24 19:50:33 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.17 2007/11/12 23:59:41 mpf Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -453,14 +453,6 @@ lgetc(int quotec)
yylval.lineno = file->lineno;
file->lineno++;
}
- if (c == '\t' || c == ' ') {
- /* Compress blanks to a single space. */
- do {
- c = getc(file->stream);
- } while (c == '\t' || c == ' ');
- ungetc(c, file->stream);
- c = ' ';
- }
while (c == EOF) {
if (popfile() == EOF)
@@ -517,7 +509,7 @@ yylex(void)
top:
p = buf;
- while ((c = lgetc(0)) == ' ')
+ while ((c = lgetc(0)) == ' ' || c == '\t')
; /* nothing */
yylval.lineno = file->lineno;