From a8ae99647dd4d540346030718e08a083b0fbdf42 Mon Sep 17 00:00:00 2001 From: ss161016 Date: Tue, 27 Dec 2005 00:48:14 -0800 Subject: 6240436 pr improperly rejects command line arguments --- usr/src/cmd/pr/pr.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'usr/src/cmd/pr') diff --git a/usr/src/cmd/pr/pr.c b/usr/src/cmd/pr/pr.c index 388da75835..467245e986 100644 --- a/usr/src/cmd/pr/pr.c +++ b/usr/src/cmd/pr/pr.c @@ -248,6 +248,7 @@ findopt(int argc, char **argv) int argv_ind; int end_opt; int i; + int isarg = 0; fixtty(); @@ -279,10 +280,20 @@ findopt(int argc, char **argv) end_opt++; break; } + + if (argv[optnum][1] == 'h' || argv[optnum][1] == 'l' || + argv[optnum][1] == 'o' || argv[optnum][1] == 'w') + isarg = 1; + else + isarg = 0; + break; default: - end_opt++; + if (isarg == 0) + end_opt++; + else + isarg = 0; break; } } -- cgit v1.2.3