Only interpret the last command line argument as a file to

be preprocessed if it is specified as an absolute pathname.

PR:		bin/16179
This commit is contained in:
Ruslan Ermilov 2000-10-11 12:17:06 +00:00
parent f68135e505
commit de2e7393d6
2 changed files with 7 additions and 5 deletions

View file

@ -20,7 +20,7 @@
.Oc
.Op Fl U Ar macro
.Oc
.Ar file
.Ar pathname
.Nm ipfw
.Op Fl f | q
.Cm flush
@ -207,8 +207,10 @@ To ease configuration, rules can be put into a file which is
processed using
.Nm
as shown in the first synopsis line.
The
.Ar file
An absolute
.Ar pathname
must be used.
The file
will be read line by line and applied as arguments to the
.Nm
utility.
@ -216,7 +218,7 @@ utility.
Optionally, a preprocessor can be specified using
.Fl p Ar preproc
where
.Ar file
.Ar pathname
is to be piped through.
Useful preprocessors include
.Xr cpp 1

View file

@ -2363,7 +2363,7 @@ main(ac, av)
* directory, things will fail miserably.
*/
if (ac > 1 && access(av[ac - 1], R_OK) == 0) {
if (ac > 1 && av[ac - 1][0] == '/' && access(av[ac - 1], R_OK) == 0) {
qflag = pflag = i = 0;
lineno = 0;