History

configure: handle spaces correctly in $source_path

Add very few missing quotes where IFS/globs were applied to arbitrary user input (commands, arguments, but not assignments or case $var in. In fn_makelink $dn/$2/$f don't have IFS/globs). While configure now handles it correctly, there are 2 issues: - eval opt=\"$opt\" coalesces IFS chars (--prefix="$HOME/x y"). - Even with the eval removed, (gnu) make still fails to find it. I made few quick experiments with quoting these values in config.mak, but that had no impact, and make -d was not helpful. Was worth a try. So no spaces in paths, but at least configure can handle the src path.

Avi Halachmi (:avih) committed 1 year ago

Commit c45559e1 parent 9289c6c1 file · +4 −4Browse files

Unified · Split

configure+4−4
@@ -438,7 +438,7 @@ fi · 437 unmodified lines
438438
439439 if test -z "$build_cross"; then
440440 CONFTEST=./conftest$EXESUF
441− if ! $cc -o $CONFTEST $source_path/conftest.c ; then
441+ if ! $cc -o $CONFTEST "$source_path/conftest.c" ; then
442442 echo "configure: error: '$cc' failed to compile conftest.c."
443443 else
444444 cc_name="$($CONFTEST compiler)"
@@ -553,7 +553,7 @@ fcho "Switches " "$tcc_switches" · 108 unmodified lines
553553 fcho "Config " "${confvars# }"
554554 echo "Creating config.mak and config.h"
555555
556−version=`head $source_path/VERSION`
556+version=$(head "$source_path/VERSION")
557557
558558 cat >config.mak <<EOF
559559 # Automatically generated by configure - do not modify
@@ -726,13 +726,13 @@ fn_makelink() · 166 unmodified lines
726726 ;;
727727 esac
728728
729− ln -sfn $tgt $2 || ( echo "ln failed. Using cp instead."; cp -f $1/$2 $2 )
729+ ln -sfn "$tgt" $2 || ( echo "ln failed. Using cp instead."; cp -f "$1/$2" $2 )
730730 }
731731
732732 if test "$source_path_used" = "yes" ; then
733733 FILES="Makefile lib/Makefile tests/Makefile tests/tests2/Makefile tests/pp/Makefile"
734734 for f in $FILES ; do
735− fn_makelink $source_path $f
735+ fn_makelink "$source_path" $f
736736 done
737737 fi
738738

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t