Browse Source

fix linecount bug with comments spanning multiple lines

problem reported with the obvious fix for bgpd by Sebastian Benoit
<benoit-lists at fb12.de>, also PR 6432
applied to all the others by yours truly. ok theo
isn't it amazing how far this parser (and more) spread?
OPENBSD_4_8
henning 14 years ago
parent
commit
029fb73afa
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      src/usr.sbin/ntpd/parse.y

+ 4
- 3
src/usr.sbin/ntpd/parse.y View File

@ -1,4 +1,4 @@
/* $OpenBSD: parse.y,v 1.46 2009/03/31 21:03:48 tobias Exp $ */
/* $OpenBSD: parse.y,v 1.47 2010/08/03 18:42:40 henning Exp $ */
/* /*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -468,9 +468,10 @@ yylex(void)
return (0); return (0);
if (next == quotec || c == ' ' || c == '\t') if (next == quotec || c == ' ' || c == '\t')
c = next; c = next;
else if (next == '\n')
else if (next == '\n') {
file->lineno++;
continue; continue;
else
} else
lungetc(next); lungetc(next);
} else if (c == quotec) { } else if (c == quotec) {
*p = '\0'; *p = '\0';


Loading…
Cancel
Save