summaryrefslogtreecommitdiffstats
path: root/bin/ps
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2001-08-16 02:41:42 +0000
committerbrian <brian@FreeBSD.org>2001-08-16 02:41:42 +0000
commit9efa99824aa704a474d3dfb3f2c9744d5b554abf (patch)
treebc563ff8565da65670e9c85f35773b752f2fcbc3 /bin/ps
parentf0911c2f1b04b76e4ccece20d8252ce71c815321 (diff)
downloadFreeBSD-src-9efa99824aa704a474d3dfb3f2c9744d5b554abf.zip
FreeBSD-src-9efa99824aa704a474d3dfb3f2c9744d5b554abf.tar.gz
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
Diffstat (limited to 'bin/ps')
-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