[PATCH] debuginstall: handle quoted path for editor (issue4316)
Matt Mackall
mpm at selenic.com
Wed Jul 30 16:12:09 CDT 2014
On Tue, 2014-07-29 at 23:01 +0200, Alexandre Garnier wrote:
> # HG changeset patch
> # User Alexandre Garnier <zigarn at gmail.com>
> # Date 1406665496 -7200
> # Tue Jul 29 22:24:56 2014 +0200
> # Branch stable
> # Node ID b817183e354981f9088a85dea76dbc865c013d3a
> # Parent ad56fc55cbc3870d257e163469c687088627283b
> debuginstall: handle quoted path for editor (issue4316)
> + or util.findexe(re.search(r"^'?([^']+)'?(?:\s+.*)?", editor).group(1)))
Looks like this regex has some problems:
>>> re.search(r"^'?([^']+)'?(?:\s+.*)?", "emacs -opt").group(1)
'emacs -opt'
>>> re.search(r"^'?([^']+)'?(?:\s+.*)?", '"emacs -opt" blah').group(1)
'"emacs -opt" blah'
Probably wants to use shlex.
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial-devel
mailing list