File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -208,9 +208,11 @@ execute() {
208208}
209209
210210# Fail with a clear message if the input contains any bell characters.
211- if eval " [ \"\$ {*#*${lsep} }\" != \"\$ *\" ]" ; then
212- die " Compiler command line contains our separator ('${lsep} '). Cannot parse."
213- fi
211+ case " $* " in
212+ * " $lsep " * )
213+ die " Compiler command line contains our separator ('${lsep} '). Cannot parse."
214+ ;;
215+ esac
214216
215217# ensure required variables are set
216218for param in $params ; do
Original file line number Diff line number Diff line change @@ -363,6 +363,19 @@ test_no_wrapper_environment() {
363363 esac
364364}
365365
366+ test_separator_in_args () {
367+ wrapper_environment
368+ _out=$( " $WRAPPER_DIR /cc" " hello$( printf ' \a' ) world" 2>&1 )
369+ _rc=$?
370+ if [ " $_rc " -eq 0 ]; then
371+ fail " cc with bell char in args unexpectedly exited 0"
372+ fi
373+ case " $_out " in
374+ * " Compiler command line contains our separator" * ) ;;
375+ * ) fail " expected 'Compiler command line contains our separator' in: $_out " ;;
376+ esac
377+ }
378+
366379test_modes () {
367380 wrapper_environment
368381
@@ -1062,6 +1075,7 @@ hello.c')
10621075
10631076all_tests='
10641077test_no_wrapper_environment
1078+ test_separator_in_args
10651079test_modes
10661080test_expected_args
10671081test_expected_args_with_flags
You can’t perform that action at this time.
0 commit comments