make tests pass when build directory name contains @ $ \ " #22449
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If you build and test perl from a directory whose name contains an
@
sign (such as/tmp/hello@world/perl5
), one of the tests int/io/pipe.t
fails.This is because it takes the path to the perl binary (which is
/tmp/hello@world/perl5/perl
in our example) and interpolates it in double-quotes into a string that is then eval'd and run (viafresh_perl()
). Thus the code that the interpreter in the child process sees is:which of course tries to interpolate the (non-existent)
@world
array. (Similar problems would be caused by paths containing$
or"
characters).Switching to single quotes, as in
would fix this case, but would still be vulnerable to a path containing
'
symbols.Sidestep the problem by using
q
(to prevent variable interpolation) with a NUL byte delimiter (which cannot occur in path names).Found while investigating #22446.