Only capitalise the last `t' in ps's first argument when it's

actually part of an option argument.

Submitted by:	Chris Costello <chris@calldei.com>
MFC after:	6 weeks
This commit is contained in:
brian 2001-08-16 02:41:42 +00:00
parent f0911c2f1b
commit 9efa99824a

View File

@ -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 {
/*