2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-29 04:50:21 +00:00

Assure something that goes in as path to fullpath comes out as path

This commit is contained in:
Jarrod Johnson 2014-02-22 17:31:08 -05:00
parent 974902cc7b
commit a8f48c7955

View File

@ -92,7 +92,7 @@ def rcompleter(text, state):
if currpos and cline[-1] == ' ':
lastarg = ''
currpos += 1
else:
elif currpos:
lastarg = args[-1]
if currpos <= 1:
foundcount = 0
@ -214,6 +214,8 @@ def fullpath_target(path, forcepath=False):
if path == '':
return target
pathcomponents = path.split("/")
if pathcomponents[-1] == "": # preserve path
forcepath=True
if pathcomponents[0] == "": # absolute path
ntarget = path
else:
@ -226,7 +228,7 @@ def fullpath_target(path, forcepath=False):
del targparts[-1]
else:
targparts.append(component)
if forcepath:
if forcepath and targparts[-1] != "":
targparts.append('')
ntarget = '/'.join(targparts)
if forcepath and (len(ntarget) == 0 or ntarget[-1] != '/'):