summaryrefslogtreecommitdiffstats
path: root/bin/ps/fmt.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-03-09 20:40:17 +0000
committerdg <dg@FreeBSD.org>1995-03-09 20:40:17 +0000
commit612646eb4c89bcb42499c191efbfae6fab0089b1 (patch)
tree63e03db4bb91abe831dcf20ecd301a2f8c43de20 /bin/ps/fmt.c
parent73699a95c4ee3a5d9a07cf616a899305afebd314 (diff)
downloadFreeBSD-src-612646eb4c89bcb42499c191efbfae6fab0089b1.zip
FreeBSD-src-612646eb4c89bcb42499c191efbfae6fab0089b1.tar.gz
Fix previous fix that removes an unnecessary space; the output is now
just like it was in 1.1.5.
Diffstat (limited to 'bin/ps/fmt.c')
-rw-r--r--bin/ps/fmt.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/ps/fmt.c b/bin/ps/fmt.c
index 43d2c29..ce8efe9 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);
OpenPOWER on IntegriCloud