* fix issue#7476

This commit is contained in:
Jack Diederich 2010-02-22 21:27:38 +00:00
parent f2055ae43d
commit 5cac46dd41
3 changed files with 6 additions and 0 deletions

View file

@ -267,10 +267,13 @@ _safechars = string.ascii_letters + string.digits + '!@%_-+=:,./' # Safe unquote
_funnychars = '"`$\\' # Unsafe inside "double quotes"
def quote(file):
''' return a shell-escaped version of the file string '''
for c in file:
if c not in _safechars:
break
else:
if not file:
return "''"
return file
if '\'' not in file:
return '\'' + file + '\''