mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
Fix the kludge-old-options processing so `ps tpt' will be treated the
same as `ps -tpt', instead of being changed into `ps -tpT'. PR: bin/52489 Submitted by: Jilles Tjoelker MFC after: 1 week
This commit is contained in:
parent
25fbb2c38c
commit
2631c7774f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=129634
@ -1104,11 +1104,12 @@ kludge_oldps_options(char *s)
|
||||
* 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.
|
||||
* However, if a flag accepting a string argument is found earlier
|
||||
* in the option string (including a possible `t' flag), then the
|
||||
* remainder of the string must be the argument to that flag; so
|
||||
* do not modify that argument.
|
||||
*/
|
||||
if (strcspn(s, "MNOoU") == len && *cp == 't' && *s != '-')
|
||||
if (*cp == 't' && *s != '-' && strcspn(s, "MNOoUt") == len - 1)
|
||||
*cp = 'T';
|
||||
else {
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user