summaryrefslogtreecommitdiffstats
path: root/iptables-restore.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-01-29 13:46:01 +0000
committerPatrick McHardy <kaber@trash.net>2008-01-29 13:46:01 +0000
commitfe05c768f877bcc69c13d7a9cb1d2b33ef56f600 (patch)
tree037a059fd364e4bf55f79d1d383aab350cf58776 /iptables-restore.c
parent3bf54dffc605c88f10b0937c5e3e980328b64b72 (diff)
allow empty strings in argument parser
Max Kellermann <max@duempel.org>
Diffstat (limited to 'iptables-restore.c')
-rw-r--r--iptables-restore.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/iptables-restore.c b/iptables-restore.c
index 2522b0f5..44263cee 100644
--- a/iptables-restore.c
+++ b/iptables-restore.c
@@ -373,14 +373,12 @@ main(int argc, char *argv[])
for (curchar = parsestart; *curchar; curchar++) {
char param_buffer[1024];
- if (escaped) {
- param_buffer[param_len++] = *curchar;
- escaped = 0;
- continue;
- }
-
if (quote_open) {
- if (*curchar == '\\') {
+ if (escaped) {
+ param_buffer[param_len++] = *curchar;
+ escaped = 0;
+ continue;
+ } else if (*curchar == '\\') {
escaped = 1;
continue;
} else if (*curchar == '"') {