summaryrefslogtreecommitdiffstats
path: root/sbin/ipfw/ipfw2.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/ipfw/ipfw2.c')
-rw-r--r--sbin/ipfw/ipfw2.c35
1 files changed, 14 insertions, 21 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c
index e9ea0e1..c038dd3 100644
--- a/sbin/ipfw/ipfw2.c
+++ b/sbin/ipfw/ipfw2.c
@@ -3429,28 +3429,8 @@ ipfw_readfile(int ac, char *av[])
pid_t preproc = 0;
int c;
- while ((c = getopt(ac, av, "D:U:p:q")) != -1)
+ while ((c = getopt(ac, av, "p:q")) != -1) {
switch(c) {
- case 'D':
- if (!pflag)
- errx(EX_USAGE, "-D requires -p");
- if (i > MAX_ARGS - 2)
- errx(EX_USAGE,
- "too many -D or -U options");
- args[i++] = "-D";
- args[i++] = optarg;
- break;
-
- case 'U':
- if (!pflag)
- errx(EX_USAGE, "-U requires -p");
- if (i > MAX_ARGS - 2)
- errx(EX_USAGE,
- "too many -D or -U options");
- args[i++] = "-U";
- args[i++] = optarg;
- break;
-
case 'p':
pflag = 1;
cmd = optarg;
@@ -3467,6 +3447,19 @@ ipfw_readfile(int ac, char *av[])
" summary ``ipfw''");
}
+ if (pflag)
+ break;
+ }
+
+ if (pflag) {
+ /* Pass all but the last argument to the preprocessor. */
+ while (optind < ac - 1) {
+ if (i >= MAX_ARGS)
+ errx(EX_USAGE, "too many preprocessor options");
+ args[i++] = av[optind++];
+ }
+ }
+
av += optind;
ac -= optind;
if (ac != 1)
OpenPOWER on IntegriCloud