Handle empty path for file completion

This also allows us to select drives on Windows hopefully...
This commit is contained in:
Florian Bruhin 2016-11-02 23:11:16 +01:00
parent cbf1a44b75
commit 732e7c260b

View File

@ -550,13 +550,12 @@ class FilenamePrompt(_BasePrompt):
if os.altsep is not None:
separators += os.altsep
if not path:
return
dirname = os.path.dirname(path)
try:
if path in separators and os.path.isdir(path):
if not path:
pass
elif path in separators and os.path.isdir(path):
# Input "/" -> don't strip anything
pass
elif path[-1] in separators and os.path.isdir(path):