diff options
author | brian <brian@FreeBSD.org> | 2001-08-16 02:41:42 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2001-08-16 02:41:42 +0000 |
commit | 9efa99824aa704a474d3dfb3f2c9744d5b554abf (patch) | |
tree | bc563ff8565da65670e9c85f35773b752f2fcbc3 /bin/ps | |
parent | f0911c2f1b04b76e4ccece20d8252ce71c815321 (diff) | |
download | FreeBSD-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.c | 6 |
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 { /* |