1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-02-02 17:08:56 +00:00

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 Somers 2001-08-16 02:41:42 +00:00
parent f7acb7e404
commit 380434d488
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=81743

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