sb/path: Walk up to root checking if a path is writable.

A dirname of / is / so the path will never have a length of 0.

Close #3392
This commit is contained in:
Chris Johns 2018-04-13 13:02:51 +10:00
parent 162cbda055
commit cabaff8206

View File

@ -143,7 +143,7 @@ def iswritable(path):
def ispathwritable(path): def ispathwritable(path):
path = shell(path) path = shell(path)
while len(path) != 0: while len(path) > 1:
if exists(path): if exists(path):
return iswritable(path) return iswritable(path)
path = dirname(path) path = dirname(path)