From: David Levine Date: Sat, 15 Sep 2012 18:14:18 +0000 (-0500) Subject: Changed ; to && in shell command, per Ralph's suggestion. There X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=b3bc649e0562c9aa68acdf7fb5c8c03335cafb25;p=mmh 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. --- 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;