From 0158123b58273dd0af5a8bce8d883d218379a1d9 Mon Sep 17 00:00:00 2001 From: Bart De Schuymer Date: Sun, 24 Jul 2005 09:46:09 +0000 Subject: allow -I without rule number --- ebtables.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'ebtables.c') diff --git a/ebtables.c b/ebtables.c index 2b0807f..08a9e57 100644 --- a/ebtables.c +++ b/ebtables.c @@ -712,11 +712,13 @@ int do_command(int argc, char *argv[], int exec_style, return -1; } else if (c == 'I') { if (optind >= argc || (argv[optind][0] == '-' && (argv[optind][1] < '0' || argv[optind][1] > '9'))) - ebt_print_error2("No rulenr for -I specified"); - rule_nr = strtol(argv[optind], &buffer, 10); - if (*buffer != '\0') - ebt_print_error2("Problem with the specified rule number '%s'", argv[optind]); - optind++; + rule_nr = 1; + else { + rule_nr = strtol(argv[optind], &buffer, 10); + if (*buffer != '\0') + ebt_print_error2("Problem with the specified rule number '%s'", argv[optind]); + optind++; + } } else if (c == 'P') { handle_P: if (optind >= argc) -- cgit v1.2.3