summaryrefslogtreecommitdiff
path: root/bin
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 /bin
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@
Diffstat (limited to 'bin')
-rw-r--r--bin/chio/parse.y12
1 files changed, 2 insertions, 10 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;