Browse Source

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@
OPENBSD_4_3
mpf 17 years ago
parent
commit
e2f849e9a7
1 changed files with 2 additions and 10 deletions
  1. +2
    -10
      src/usr.sbin/ntpd/parse.y

+ 2
- 10
src/usr.sbin/ntpd/parse.y View File

@ -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;


Loading…
Cancel
Save