From 6d753bdd672506f291807941a290e8b900fad08b Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Sun, 1 Oct 1995 15:11:42 +0000 Subject: [PATCH] Posixize: sh -c [-aCefinuvx] command_string [ command_name [argument ...] ] 1 4.56.3 Options -c Read commands from the command_string operand. Set the value of special parameter 0 (see 3.5.2) from the value of the command_name operand and the positional parameters ($1, $2, etc.) in sequence from the remaining argument operands. Pointed out by: Kaleb Keithly (kaleb@x.org) --- bin/sh/options.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/sh/options.c b/bin/sh/options.c index 92e04caa25bd..de6f60ce7fb9 100644 --- a/bin/sh/options.c +++ b/bin/sh/options.c @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: options.c,v 1.3 1995/05/30 00:07:21 rgrimes Exp $ + * $Id: options.c,v 1.4 1995/08/06 19:35:33 joerg Exp $ */ #ifndef lint @@ -106,6 +106,9 @@ procargs(argc, argv) commandname = arg0 = *argptr++; setinputfile(commandname, 0); } + if (minusc) + /* Posix.2: first arg after -c cmd is $0, remainder $1... */ + arg0 = *argptr++; shellparam.p = argptr; /* assert(shellparam.malloc == 0 && shellparam.nparam == 0); */ while (*argptr) {