diff options
author | David Greenman <dg@FreeBSD.org> | 1995-03-09 20:40:17 +0000 |
---|---|---|
committer | David Greenman <dg@FreeBSD.org> | 1995-03-09 20:40:17 +0000 |
commit | 632f53dd4f65ff66a3bf74d1abc16994ebf32b19 (patch) | |
tree | 63e03db4bb91abe831dcf20ecd301a2f8c43de20 /bin/ps | |
parent | bff1f1d0dda3af7e41eddc0f492d70ba65863c57 (diff) | |
download | src-632f53dd4f65ff66a3bf74d1abc16994ebf32b19.tar.gz src-632f53dd4f65ff66a3bf74d1abc16994ebf32b19.zip |
Fix previous fix that removes an unnecessary space; the output is now
just like it was in 1.1.5.
Notes
Notes:
svn path=/head/; revision=6971
Diffstat (limited to 'bin/ps')
-rw-r--r-- | bin/ps/fmt.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/ps/fmt.c b/bin/ps/fmt.c index 43d2c29215c8..ce8efe902fab 100644 --- a/bin/ps/fmt.c +++ b/bin/ps/fmt.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: fmt.c,v 1.3 1994/09/24 02:56:43 davidg Exp $ + * $Id: fmt.c,v 1.4 1994/11/10 23:25:12 ats Exp $ */ #ifndef lint @@ -75,6 +75,9 @@ shquote(argv) dst++; *dst++ = ' '; } + /* Chop off trailing space */ + if (dst != buf) + dst--; *dst = '\0'; return (buf); } @@ -109,9 +112,9 @@ fmt_argv(argv, cmd, maxlen) if ((cp = malloc(len)) == NULL) return (NULL); if (ap == NULL) - sprintf(cp, "(%.*s)", maxlen, cmd); + sprintf(cp, " (%.*s)", maxlen, cmd); else if (strncmp(cmdpart(argv[0]), cmd, maxlen) != 0) - sprintf(cp, "%s(%.*s)", ap, maxlen, cmd); + sprintf(cp, "%s (%.*s)", ap, maxlen, cmd); else (void) strcpy(cp, ap); return (cp); |