summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/ps/ps.c6
1 files changed, 5 insertions, 1 deletions
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 {
/*
OpenPOWER on IntegriCloud