projects
/
project
/
firewall3.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
e43e3cc
)
Fix processing of negated options
author
Jo-Philipp Wich
<jow@openwrt.org>
Thu, 13 Jun 2013 15:14:07 +0000
(17:14 +0200)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Thu, 13 Jun 2013 18:52:58 +0000
(20:52 +0200)
iptables.c
patch
|
blob
|
history
diff --git
a/iptables.c
b/iptables.c
index
ab3b302
..
df0d704
100644
(file)
--- a/
iptables.c
+++ b/
iptables.c
@@
-22,7
+22,6
@@
static struct option base_opts[] = {
{ .name = "match", .has_arg = 1, .val = 'm' },
{ .name = "jump", .has_arg = 1, .val = 'j' },
static struct option base_opts[] = {
{ .name = "match", .has_arg = 1, .val = 'm' },
{ .name = "jump", .has_arg = 1, .val = 'j' },
- { .name = "append", .has_arg = 1, .val = 'A' },
{ NULL }
};
{ NULL }
};
@@
-1337,7
+1336,8
@@
__fw3_ipt_rule_append(struct fw3_ipt_rule *r, bool repl, const char *fmt, ...)
optind = 0;
opterr = 0;
optind = 0;
opterr = 0;
- while ((optc = getopt_long(r->argc, r->argv, "m:j:", g->opts, NULL)) != -1)
+ while ((optc = getopt_long(r->argc, r->argv, "-:m:j:", g->opts,
+ NULL)) != -1)
{
switch (optc)
{
{
switch (optc)
{
@@
-1367,6
+1367,7
@@
__fw3_ipt_rule_append(struct fw3_ipt_rule *r, bool repl, const char *fmt, ...)
case 1:
if ((optarg[0] == '!') && (optarg[1] == '\0'))
{
case 1:
if ((optarg[0] == '!') && (optarg[1] == '\0'))
{
+ optarg[0] = '\0';
inv = true;
continue;
}
inv = true;
continue;
}