mirror of
https://github.com/altlinux/gpupdate.git
synced 2025-03-21 18:50:38 +03:00
Fixed premature removal of double slash
This commit is contained in:
parent
3794ffa5be
commit
9b4527d334
@ -51,7 +51,7 @@ def str2bool(boolstr):
|
||||
|
||||
class Folder:
|
||||
def __init__(self, folder_object, username=None):
|
||||
folder_path = expand_windows_var(folder_object.path, username).replace('\\', '/')
|
||||
folder_path = expand_windows_var(folder_object.path, username).replace('\\', '/').replace('//', '/')
|
||||
if username:
|
||||
folder_path = folder_path.replace(get_homedir(username), '')
|
||||
self.folder_path = Path(get_homedir(username)).joinpath(folder_path if folder_path [0] != '/' else folder_path [1:])
|
||||
|
@ -317,7 +317,7 @@ def expand_windows_var(text, username=None):
|
||||
for var in variables.keys():
|
||||
result = result.replace('%{}%'.format(var),
|
||||
variables[var] if variables[var][-1] == '/'
|
||||
else variables[var] +'/').replace('//','/')
|
||||
else variables[var] +'/')
|
||||
|
||||
return result
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user