提交 f5f30699 编写于 作者: S Shawn O. Pearce

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: NShawn O. Pearce <spearce@spearce.org>
上级 46eb449c
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册