diff mercurial/posix.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 5edb387158a1
children 609aa973c01d
line wrap: on
line diff
--- a/mercurial/posix.py	Mon Feb 02 14:26:47 2015 -0500
+++ b/mercurial/posix.py	Wed Feb 11 19:57:07 2015 +0900
@@ -322,7 +322,7 @@
     global _needsshellquote
     if _needsshellquote is None:
         _needsshellquote = re.compile(r'[^a-zA-Z0-9._/-]').search
-    if not _needsshellquote(s):
+    if s and not _needsshellquote(s):
         # "s" shouldn't have to be quoted
         return s
     else: