diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-10-16 06:06:50 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-10-16 06:06:50 +0000 |
commit | 34c77c62d876eae153056388e21c73a29964c400 (patch) | |
tree | 152491e491fe3e85b98696e2cce7737d5c031ed5 /sbin | |
parent | 861a8179aab10b8d4a585f385b99ce455781c996 (diff) |
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
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ipsecctl/parse.y | 6 | ||||
-rw-r--r-- | sbin/pfctl/parse.y | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/sbin/ipsecctl/parse.y b/sbin/ipsecctl/parse.y index 0bfd11e8612..895c9d09052 100644 --- a/sbin/ipsecctl/parse.y +++ b/sbin/ipsecctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.128 2007/10/13 16:35:18 deraadt Exp $ */ +/* $OpenBSD: parse.y,v 1.129 2007/10/16 06:06:49 deraadt Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -1070,8 +1070,10 @@ top: } else if (c == '\\') { if ((next = lgetc(quotec)) == EOF) return (0); - if (next == quotec) + if (next == quotec || c == ' ' || c == '\t') c = next; + else if (next == '\n') + continue; else lungetc(next); } else if (c == quotec) { diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 9abf4c5e280..4418a04c8e8 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.528 2007/10/13 21:49:13 deraadt Exp $ */ +/* $OpenBSD: parse.y,v 1.529 2007/10/16 06:06:49 deraadt Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -5326,8 +5326,10 @@ top: } else if (c == '\\') { if ((next = lgetc(quotec)) == EOF) return (0); - if (next == quotec) + if (next == quotec || c == ' ' || c == '\t') c = next; + else if (next == '\n') + continue; else lungetc(next); } else if (c == quotec) { |