Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Keep the robustness tests to portable shell
An unquoted $cgitbin breaks in a checkout whose path holds a space,
and head -c and head -1 are not POSIX. The status of the disconnected
request is still read right after its pipeline, which assumes the
shell waits for the left side as dash, bash, ksh and busybox ash all
do.
Diffstat (limited to 'tests/t0301-security.sh')
| -rwxr-xr-x | tests/t0301-security.sh | 4 |
1 file changed, 2 insertions, 2 deletions
diff --git a/tests/t0301-security.sh b/tests/t0301-security.sh index f7befe8..4626c2c 100755 --- a/tests/t0301-security.sh +++ b/tests/t0301-security.sh @@ -135,8 +135,8 @@ test_expect_success 'no page carries an inline handler' ' # upstream covers it. test_expect_success 'tree groups directories before files' ' cgit_rc seccgitrc "url=sec/tree/" >tmp && - dirline=$(grep -n "tree/zsub" tmp | head -1 | cut -d: -f1) && - fileline=$(grep -n "tree/afile" tmp | head -1 | cut -d: -f1) && + dirline=$(grep -n "tree/zsub" tmp | head -n 1 | cut -d: -f1) && + fileline=$(grep -n "tree/afile" tmp | head -n 1 | cut -d: -f1) && test -n "$dirline" && test -n "$fileline" && test "$dirline" -lt "$fileline" |
