{"thread":{"id":"9847","subject":"[PATCH] Remove non-POSIX 'expr index' from instaweb.","startedAt":"2007-09-14T22:01:04Z","lastAt":"2007-09-14T22:01:04Z","messageCount":1,"participants":["Bryan Larsen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"53059","messageId":"ef57d1660709141501m332b31a5yc5f3644c1edbdd0e@mail.gmail.com","threadId":"9847","inReplyTo":null,"subject":"[PATCH] Remove non-POSIX 'expr index' from instaweb.","fromName":"Bryan Larsen","fromEmail":"bryan@larsen.st","sentAt":"2007-09-14T22:01:04Z","receivedAt":"2007-09-14T22:01:04Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"git-instaweb.sh uses the non-POSIX 'expr index' command, which\nis not present on some BSD's.  This patch replaces this usage\nwith a simple grep expression.\n\nSigned-off-by: Bryan Larsen < bryan@larsen.st>\n---\n git-instaweb.sh |    3 +--\n 1 files changed, 1 insertions(+), 2 deletions(-)\n\ndiff --git a/git-instaweb.sh b/git-instaweb.sh\nindex ce631a0..ef1a4bf 100755\n--- a/git-instaweb.sh\n+++ b/git-instaweb.sh\n@@ -30,8 +30,7 @@ test -z \"$port\" && port=1234\n\n start_httpd () {\n        httpd_only=\"`echo $httpd | cut -f1 -d' '`\"\n-       if test \"`expr index $httpd_only /`\" -eq '1' || \\\n-                               which $httpd_only >/dev/null\n+       if test echo $http_only | grep ^/ || which $httpd_only >/dev/null\n        then\n                $httpd $fqgitdir/gitweb/httpd.conf\n        else\n-- \n1.5.3.1\n"}]}