From: Christian Couder Date: Sun, 18 Sep 2011 14:46:35 GMT Subject: Re: git web--browse error handling URL with & in it (Was Re: [RFC/PATCH] Configurable hyperlinking in gitk) Message-ID: <201109181646.36821.chriscool@tuxfamily.org> In-Reply-To: <20110918032933.GA17977@sigill.intra.peff.net> Hi, On Sunday 18 September 2011 05:29:34 Jeff King wrote: > On Sun, Sep 18, 2011 at 12:32:04PM +1200, Chris Packham wrote: > > Update: it's the call to eval that causes the problem > > > > eval kfmclient newTab https://internalhost/code\&stuff/bugs.php?id=foo > > [1] 14728 > > bash: stuff/bugs.php?id=foo: No such file or directory > > Hmm. The offending lines look like: > > eval "$browser_path" "$@" & > > Normally in git we treat user-configured commands as shell snippets, > meaning the user is responsible for any quoting. But in this script, we > seem to run: > > type "$browser_path" > > several times. Which implies that "$browser_path" must be the actual > executable. In which case, I would think that: > > "$browser_path" "$@" & > > would be the right thing. And indeed, that is what the firefox arm of > the case statement does. But chrome, konqueror, and others use eval. Yeah, I don't remember why I sometimes used 'eval "$browser_path" "$@"' when I wrote this code. Sorry! > Unrelated, but it also looks like $browser_path is used unquoted in the > firefox case (see inside the vers=$(...)). Thanks, Christian.