From 9efa99824aa704a474d3dfb3f2c9744d5b554abf Mon Sep 17 00:00:00 2001 From: brian Date: Thu, 16 Aug 2001 02:41:42 +0000 Subject: Only capitalise the last `t' in ps's first argument when it's actually part of an option argument. Submitted by: Chris Costello MFC after: 6 weeks --- bin/ps/ps.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'bin/ps') diff --git a/bin/ps/ps.c b/bin/ps/ps.c index 4c7189f..44bd5c2 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -599,8 +599,12 @@ kludge_oldps_options(s) * if last letter is a 't' flag with no argument (in the context * of the oldps options -- option string NOT starting with a '-' -- * then convert to 'T' (meaning *this* terminal, i.e. ttyname(0)). + * + * However, if a flag accepting a string argument is found in the + * option string, the remainder of the string is the argument to + * that flag; do not modify that argument. */ - if (*cp == 't' && *s != '-') + if (strcspn(s, "MNOoUW") == len && *cp == 't' && *s != '-') *cp = 'T'; else { /* -- cgit v1.1