Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Leave no stray variables or globs from setup.sh
The arguments were split back apart with globbing on, so one that
matched a file in tests/ reached the library as that file's name.
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/setup.sh | 13 |
1 file changed, 9 insertions, 4 deletions
diff --git a/tests/setup.sh b/tests/setup.sh index d631197..a404ac0 100755 --- a/tests/setup.sh +++ b/tests/setup.sh @@ -30,10 +30,15 @@ do shift done -OLDIFS=$IFS +# Globbing is off while the arguments are split apart again, so one that looks +# like a pattern reaches the library as it was given. +cgit_ifs=$IFS IFS=$LF +set -f set -- $test_argv -IFS=$OLDIFS +set +f +IFS=$cgit_ifs +unset test_argv cgit_ifs # The library takes these from the environment when they are set there, so # they are set outright, or a shell set up for work on Git itself would point @@ -314,9 +319,9 @@ cgit_ok_url() { # The response headers run down to the first empty line, and a test comparing # two pages wants to see the bodies alone. strip_headers() { - while read -r line + while read -r strip_headers_line do - test -z "$line" && break + test -z "$strip_headers_line" && break done cat } |
