diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-07-25 12:35:10 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-07-25 12:36:16 -0700 |
commit | bfce5087ee01fdead5cdc52180c8eef22adbbd71 (patch) | |
tree | b38a930d7da004996bda676e3d6679bcb1df3bfc /Makefile | |
parent | c30e699fc509f43f459c17d3148e7d866fb9157a (diff) | |
download | git-bfce5087ee01fdead5cdc52180c8eef22adbbd71.tar.gz |
Makefile: fix shell quoting
Makefile records paths to a few programs in GIT-BUILD-OPTIONS file. These
paths need to be quoted twice: once to protect specials from the shell
that runs the generated GIT-BUILD-OPTIONS file, and again to protect them
(and the first level of quoting itself) from the shell that runs the
"echo" inside the Makefile.
You can test this by trying:
$ ln -s /bin/tar "$HOME/Tes' program/tar"
$ make TAR="$HOME/Tes' program/tar" test
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1210,9 +1210,12 @@ GIT-CFLAGS: .FORCE-GIT-CFLAGS echo "$$FLAGS" >GIT-CFLAGS; \ fi +# We need to apply sq twice, once to protect from the shell +# that runs GIT-BUILD-OPTIONS, and then again to protect it +# and the first level quoting from the shell that runs "echo". GIT-BUILD-OPTIONS: .FORCE-GIT-BUILD-OPTIONS - @echo SHELL_PATH=\''$(SHELL_PATH_SQ)'\' >$@ - @echo TAR=\''$(subst ','\'',$(TAR))'\' >>$@ + @echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@ + @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@ ### Detect Tck/Tk interpreter path changes ifndef NO_TCLTK |