From b3bc649e0562c9aa68acdf7fb5c8c03335cafb25 Mon Sep 17 00:00:00 2001 From: David Levine Date: Sat, 15 Sep 2012 13:14:18 -0500 Subject: [PATCH] Changed ; to && in shell command, per Ralph's suggestion. There were two remaining places that still used ";". Though they weren't of consequence, it's the right thing to do. --- uip/whatnowsbr.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index c370a99..4aaf921 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -336,7 +336,7 @@ WhatNow (int argc, char **argv) */ if (*(argp+1) == (char *)0) { - (void)sprintf(buf, "$SHELL -c \"cd;pwd\""); + (void)sprintf(buf, "$SHELL -c \"cd&&pwd\""); } else { writesomecmd(buf, BUFSIZ, "cd", "pwd", argp); @@ -561,9 +561,9 @@ writesomecmd(char *buf, int bufsz, char *cmd, char *trailcmd, char **argp) * new C99 mandated 'number of chars that would have been written' */ /* length checks here and inside the loop allow for the - * trailing ';', trailcmd, '"' and NUL + * trailing "&&", trailcmd, '"' and NUL */ - int trailln = strlen(trailcmd) + 3; + int trailln = strlen(trailcmd) + 4; if (ln < 0 || ln + trailln > bufsz) adios((char *)0, "arguments too long"); @@ -579,9 +579,9 @@ writesomecmd(char *buf, int bufsz, char *cmd, char *trailcmd, char **argp) cp += ln; } if (*trailcmd) { - *cp++ = ';'; + *cp++ = '&'; *cp++ = '&'; strcpy(cp, trailcmd); - cp += trailln - 3; + cp += trailln - 4; } *cp++ = '"'; *cp = 0; -- 1.7.10.4