When skipping white space after #! to find the interpreter

only skip ' ' and tabs.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15063
This commit is contained in:
Florian Krohm 2015-04-02 16:07:41 +00:00
parent 9b8670b58d
commit 909b88c40b
6 changed files with 13 additions and 1 deletions

View File

@ -55,7 +55,7 @@ Bool VG_(match_script)(const void *hdr, Int len)
// Find interpreter name, make sure it's an absolute path (starts with
// '/') and has at least one more char. First, skip over any space
// between the #! and the start of the interpreter name
while (interp < end && VG_(isspace)(*interp)) interp++;
while (interp < end && (*interp == ' ' || *interp == '\t')) interp++;
// overrun?
if (interp >= end) return False; // can't find start of interp name

View File

@ -159,6 +159,7 @@ EXTRA_DIST = \
shell_valid1 shell_valid1.vgtest shell_valid1.stderr.exp \
shell_valid2 shell_valid2.vgtest shell_valid2.stderr.exp \
shell_valid3 shell_valid3.vgtest shell_valid3.stderr.exp \
shell_valid4 shell_valid4.vgtest shell_valid4.stderr.exp shell_valid4.stdout.exp \
shell_zerolength shell_zerolength.vgtest shell_zerolength.stderr.exp \
shell_zerolength.stderr.exp-dash \
sha1_test.stderr.exp sha1_test.vgtest \

3
none/tests/shell_valid4 Executable file
View File

@ -0,0 +1,3 @@
#!
/bin/echo

View File

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,7 @@
#
# This test used to write
# ./shell_valid4
# to stdout which is not what happens when executed natively.
#
prog: shell_valid4
vgopts: -q