mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-25 19:10:10 +00:00
Avoid crashing out if someone does too many '..'.
If user tried to change to more parent directories than existed, confetty would rudely shutdown. Truncate such a case to '/' rather than bail.
This commit is contained in:
parent
2578fd5817
commit
9292d89751
@ -298,7 +298,7 @@ def fullpath_target(path, forcepath=False):
|
||||
del targparts[-1]
|
||||
else:
|
||||
targparts.append(component)
|
||||
if forcepath and targparts[-1] != "":
|
||||
if forcepath and len(targparts) == 0 or targparts[-1] != "":
|
||||
targparts.append('')
|
||||
ntarget = '/'.join(targparts)
|
||||
if forcepath and (len(ntarget) == 0 or ntarget[-1] != '/'):
|
||||
|
Loading…
Reference in New Issue
Block a user