From c94e9a2248a89cf239e48e5b7b4472aa309ba823 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 08:22:03 -1000 Subject: 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. --- tests/setup.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'tests/setup.sh') 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 } -- cgit 2.12.1