summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-10-17 01:33:11 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-10-17 02:48:03 (GMT)
commitf5f30699c078be289daaabb61ed69e1f84747a78 (patch)
tree0049c8c6537753b1418ca8b2b4bb9dc02d386fb7
parent46eb449cbefac461659c42c4ba4b36de1959e7ca (diff)
downloadgit-f5f30699c078be289daaabb61ed69e1f84747a78.zip
git-f5f30699c078be289daaabb61ed69e1f84747a78.tar.gz
git-f5f30699c078be289daaabb61ed69e1f84747a78.tar.bz2
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 <spearce@spearce.org>
-rwxr-xr-xgit-instaweb.sh3
1 files changed, 1 insertions, 2 deletions
diff --git a/git-instaweb.sh b/git-instaweb.sh
index f5629e7..41ff08f 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