Browse Source

in the lex... even inside quotes, a \ followed by space or tab should

expand to space or tab, and a \ followed by newline should be ignored
(as a line continuation).  compatible with the needs of hoststated
(which has the most strict quoted string requirements), and ifstated
(where one commonly does line continuations in strings).
pointed out by mpf, discussed with pyr
OPENBSD_4_3
deraadt 17 years ago
parent
commit
2c7a142792
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      src/usr.sbin/ntpd/parse.y

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

@ -1,4 +1,4 @@
/* $OpenBSD: parse.y,v 1.37 2007/10/13 16:35:21 deraadt Exp $ */
/* $OpenBSD: parse.y,v 1.38 2007/10/16 06:06:49 deraadt Exp $ */
/* /*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -454,8 +454,10 @@ yylex(void)
} else if (c == '\\') { } else if (c == '\\') {
if ((next = lgetc(quotec)) == EOF) if ((next = lgetc(quotec)) == EOF)
return (0); return (0);
if (next == quotec)
if (next == quotec || c == ' ' || c == '\t')
c = next; c = next;
else if (next == '\n')
continue;
else else
lungetc(next); lungetc(next);
} else if (c == quotec) { } else if (c == quotec) {


Loading…
Cancel
Save