bugmake - Bugs: bug #61154, (w32/sub_proc.c) make_command_line...

 
 

bug #61154: (w32/sub_proc.c) make_command_line should also quote full_exec_path.

Submitter:  None
Submitted:  Tue 14 Sep 2021 03:02:34 AM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Component Version:  4.3 Operating System:  MS Windows
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 25 Sep 2022 10:54:45 PM UTC, comment #2: 

@eliz do you have any thoughts about this?

Paul D. Smith <psmith>
Group administrator
Tue 14 Sep 2021 03:43:29 AM UTC, comment #1: 

The place where `make_command_line` copies `full_exec_path` without quoting it is http://git.savannah.gnu.org/cgit/make.git/tree/src/w32/subproc/sub_proc.c#n1339, not line 1360.

Anonymous
Tue 14 Sep 2021 03:02:34 AM UTC, original submission:  


This bug occurs under win32 when make tries to execute a shell script whose full path contains spaces.

The current code at http://git.savannah.gnu.org/cgit/make.git/tree/src/w32/subproc/sub_proc.c#n1360 construct a command line that is obviously wrong when full_exec_path contains spaces. The shell then searches for a script whose name is the truncation of full_exec_path at its first white space and reports a file-not-found error.

Example: Under MSYS.

$ mkdir "/c/dir with space/"
$ cd "/c/dir with space/"

$ cat > script.sh <<EOF
#!/bin/sh
echo Hello "$@"
EOF

$ cat > Makefile <<EOF
all:
<tab>./script.sh World
EOF

$ make
./script.sh World
sh: c:\dir: No such file or directory
make: * [Makefile:2: all] Error 127

but

$ make SHELLFLAGS='-x -c'
./script.sh World
+ ./script.sh World
Hello World
$

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code