Mercurial > public > mercurial-scm > hg-stable
diff mercurial/windows.py @ 24108:d65ecb814fc0 stable
shellquote: fix missing quotes for empty string
"hg kdiff3 -rREV" did not work because 1642eb429536 and 5edb387158a1 failed
to handle empty argument.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 11 Feb 2015 19:57:07 +0900 |
parents | 1642eb429536 |
children | 7a2194473155 |
line wrap: on
line diff
--- a/mercurial/windows.py Mon Feb 02 14:26:47 2015 -0500 +++ b/mercurial/windows.py Wed Feb 11 19:57:07 2015 +0900 @@ -159,7 +159,7 @@ # they are used as a part of path name (and the latter doesn't # work as "escape character", like one on posix) on Windows _needsshellquote = re.compile(r'[^a-zA-Z0-9._:/\\-]').search - if not _needsshellquote(s) and not _quotere.search(s): + if s and not _needsshellquote(s) and not _quotere.search(s): # "s" shouldn't have to be quoted return s return '"%s"' % _quotere.sub(r'\1\1\\\2', s)