From: Max Kellermann Date: Tue, 29 Jan 2008 13:46:01 +0000 (+0000) Subject: allow empty strings in argument parser X-Git-Tag: v1.4.1-rc1~49 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fe05c768f877bcc69c13d7a9cb1d2b33ef56f600;p=thirdparty%2Fiptables.git allow empty strings in argument parser Max Kellermann --- diff --git a/ip6tables-restore.c b/ip6tables-restore.c index 2d2f8b04..570bd515 100644 --- a/ip6tables-restore.c +++ b/ip6tables-restore.c @@ -366,14 +366,12 @@ int 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 == '"') { 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 == '"') {