From: Shawn O. Pearce Date: Wed, 17 Oct 2007 01:33:11 +0000 (-0400) Subject: Avoid 'expr index' on Mac OS X as it isn't supported X-Git-Tag: v1.5.3.5~39 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f5f30699c078be289daaabb61ed69e1f84747a78;p=git.git Avoid 'expr index' on Mac OS X as it isn't supported This fixes git-instaweb so it can start an httpd without warning about an invalid test command. Yes its ugly, but its also quite portable. Signed-off-by: Shawn O. Pearce --- diff --git a/git-instaweb.sh b/git-instaweb.sh index f5629e743..41ff08f8e 100755 --- a/git-instaweb.sh +++ b/git-instaweb.sh @@ -30,8 +30,7 @@ test -z "$port" && port=1234 start_httpd () { httpd_only="`echo $httpd | cut -f1 -d' '`" - if test "`expr index $httpd_only /`" -eq '1' || \ - which $httpd_only >/dev/null + if case "$httpd_only" in /*) : ;; *) which $httpd_only >/dev/null;; esac then $httpd $fqgitdir/gitweb/httpd.conf else