Merge branch 'jk/xstrfmt'
[gitweb.git] / t / t5560-http-backend-noserver.sh
index 9be9ae3436c929921bc0a2cd2a458e4e4500c154..aa73eeaef82adff56083fdc2d5d35d599b73edee 100755 (executable)
@@ -5,12 +5,16 @@ test_description='test git-http-backend-noserver'
 
 HTTPD_DOCUMENT_ROOT_PATH="$TRASH_DIRECTORY"
 
-test_have_prereq GREP_STRIPS_CR && export GREP_OPTIONS=-U
+if test_have_prereq GREP_STRIPS_CR
+then
+       GREP_OPTIONS=-U
+       export GREP_OPTIONS
+fi
 
 run_backend() {
        echo "$2" |
-       QUERY_STRING="${1#*\?}" \
-       PATH_TRANSLATED="$HTTPD_DOCUMENT_ROOT_PATH/${1%%\?*}" \
+       QUERY_STRING="${1#*[?]}" \
+       PATH_TRANSLATED="$HTTPD_DOCUMENT_ROOT_PATH/${1%%[?]*}" \
        git http-backend >act.out 2>act.err
 }