From: Jonas Fonseca Date: Thu, 8 Nov 2007 23:21:42 +0000 (+0100) Subject: instaweb: Minor cleanups and fixes for potential problems X-Git-Tag: v1.5.3.6~28 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/9126425df1fefa6b2843a45c8b087b8d87cb1955 instaweb: Minor cleanups and fixes for potential problems Fix path quoting and test of empty values that some shells do not like. Remove duplicate check and setting of $browser. Signed-off-by: Jonas Fonseca Signed-off-by: Junio C Hamano --- diff --git a/git-instaweb.sh b/git-instaweb.sh index 41ff08f8e4..2ca487d7d5 100755 --- a/git-instaweb.sh +++ b/git-instaweb.sh @@ -15,7 +15,7 @@ browser="`git config --get instaweb.browser`" port=`git config --get instaweb.port` module_path="`git config --get instaweb.modulepath`" -conf=$GIT_DIR/gitweb/httpd.conf +conf="$GIT_DIR/gitweb/httpd.conf" # Defaults: @@ -32,7 +32,7 @@ start_httpd () { httpd_only="`echo $httpd | cut -f1 -d' '`" if case "$httpd_only" in /*) : ;; *) which $httpd_only >/dev/null;; esac then - $httpd $fqgitdir/gitweb/httpd.conf + $httpd "$fqgitdir/gitweb/httpd.conf" else # many httpds are installed in /usr/sbin or /usr/local/sbin # these days and those are not in most users $PATHs @@ -146,14 +146,14 @@ server.pid-file = "$fqgitdir/pid" cgi.assign = ( ".cgi" => "" ) mimetype.assign = ( ".css" => "text/css" ) EOF - test "$local" = true && echo 'server.bind = "127.0.0.1"' >> "$conf" + test x"$local" = xtrue && echo 'server.bind = "127.0.0.1"' >> "$conf" } apache2_conf () { test -z "$module_path" && module_path=/usr/lib/apache2/modules mkdir -p "$GIT_DIR/gitweb/logs" bind= - test "$local" = true && bind='127.0.0.1:' + test x"$local" = xtrue && bind='127.0.0.1:' echo 'text/css css' > $fqgitdir/mime.types cat > "$conf" <