From aa82c35307ac93f9f8516d4168a7cb0e7eaf56c4 Mon Sep 17 00:00:00 2001 From: Marco Pfatschbacher Date: Mon, 12 Nov 2007 23:59:42 +0000 Subject: 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@ --- usr.sbin/bgpd/parse.y | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'usr.sbin/bgpd') 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 @@ -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; -- cgit v1.2.3