Re: git web--browse error handling URL with & in it (Was Re: [RFC/PATCH] Configurable hyperlinking in gitk)
- From
Jeff King <peff@peff.net>
- Date
- Sep 18, 2011, 03:29 UTC
- Message-ID
- <20110918032933.GA17977@sigill.intra.peff.net>
- In-Reply-To
- <4E753C04.1070202@gmail.com>
On Sun, Sep 18, 2011 at 12:32:04PM +1200, Chris Packham wrote:
Show 5 quoted lines
> 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.
Unrelated, but it also looks like $browser_path is used unquoted in the firefox case (see inside the vers=$(...)).
-Peff