Opened 10 years ago

Last modified 10 years ago

#342 new defect

spawn passes commands to shell as is instead of as a command

Reported by: dmik Owned by:
Priority: normal Milestone: new
Component: libc Version: 0.6.6
Severity: critical Keywords:
Cc:

Description

Given these environment settings:

SET SHELL=sh.exe
SET EMXSHELL=sh.exe
SET MAKESHELL=sh.exe

and this INSTALL file:

lala
lala
lala

and this Makefile (in the same dir as INSTALL above):

all:
    install

doing kmk results into:

D:>kmk
install
lala: not found
lala: not found
lala: not found
kmk.exe: *** [all] Error 127

instead of:

D:>libc065 kmk
install
install: missing file operand
Try `install --help' for more information.
kmk: *** [all] Error 1

This is certainly a regression of version 0.6.6 since when I roll back to 0.6.5 it works as it should (given the output from the last snippet). Most likely it deals with one of the changes that handle shell processing in spawn and friends. Perhaps, the -c option is now somehow lost. But I didn't look through the commits so I'm not sure.

In theory this breaks any case where a file named after the command the application tries to execute happens to be present in the current directory (regardless of file name case!). In practice, this breaks e.g. the git build since there is a file named INSTALL in one of the directories where make install is run (the makefile there contains INSTALL ?= install).

This is rather critical IMHO.

Change History (1)

comment:1 by dmik, 10 years ago

As Silvan suggests, that might be #180.

Note: See TracTickets for help on using tickets.