git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] Remove non-POSIX 'expr index' from instaweb.
@ 2007-09-14 22:01 Bryan Larsen
  0 siblings, 0 replies; only message in thread
From: Bryan Larsen @ 2007-09-14 22:01 UTC (permalink / raw)
  To: git

git-instaweb.sh uses the non-POSIX 'expr index' command, which
is not present on some BSD's.  This patch replaces this usage
with a simple grep expression.

Signed-off-by: Bryan Larsen < bryan@larsen.st>
---
 git-instaweb.sh |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/git-instaweb.sh b/git-instaweb.sh
index ce631a0..ef1a4bf 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 test echo $http_only | grep ^/ || which $httpd_only >/dev/null
        then
                $httpd $fqgitdir/gitweb/httpd.conf
        else
-- 
1.5.3.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-09-14 22:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-14 22:01 [PATCH] Remove non-POSIX 'expr index' from instaweb Bryan Larsen

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).