summaryrefslogtreecommitdiffstats
path: root/ip6tables-restore.c
diff options
context:
space:
mode:
authorlaforge <laforge>2004-01-05 09:41:50 +0000
committerlaforge <laforge>2004-01-05 09:41:50 +0000
commit05be74c4f35e2833e7eb5daf7817fdcfed1926a3 (patch)
treec76943d18aec1bcc6099fa285fcce8368cb2eb40 /ip6tables-restore.c
parentba74e0bb36dae7728898edd75fa02cb41c2083c1 (diff)
allow embedding of quote character inside quoted string (Michael Rash)
Diffstat (limited to 'ip6tables-restore.c')
-rw-r--r--ip6tables-restore.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ip6tables-restore.c b/ip6tables-restore.c
index ecda870..cc60e23 100644
--- a/ip6tables-restore.c
+++ b/ip6tables-restore.c
@@ -7,7 +7,7 @@
* Rusty Russell <rusty@linuxcare.com.au>
* This code is distributed under the terms of GNU GPL v2
*
- * $Id: ip6tables-restore.c,v 1.11 2003/03/05 07:46:15 laforge Exp $
+ * $Id: ip6tables-restore.c,v 1.12 2003/05/02 15:30:11 laforge Exp $
*/
#include <getopt.h>
@@ -321,7 +321,11 @@ int main(int argc, char *argv[])
for (curchar = parsestart; *curchar; curchar++) {
if (*curchar == '"') {
- if (quote_open) {
+ /* quote_open cannot be true if there
+ * was no previous character. Thus,
+ * curchar-1 has to be within bounds */
+ if (quote_open &&
+ *(curchar-1) != '\\') {
quote_open = 0;
*curchar = ' ';
} else {