Subtlety: ~root/a should expand to /a, not //a. Everything else unchanged.
This commit is contained in:
parent
ededb58c14
commit
bbb4e10e91
|
@ -241,6 +241,7 @@ def expanduser(path):
|
|||
except KeyError:
|
||||
return path
|
||||
userhome = pwent[5]
|
||||
if userhome[-1:] == '/': i = i+1
|
||||
return userhome + path[i:]
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue