git.s-ol.nu mmm / main
mmmfs.util: fix relative paths ending with a ".." segment s-ol 17 days ago
1 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
2525 assert origin, "cannot resolve relative path '#{path}' without origin!"
2626 path = "#{origin.path}/#{path}"
2727
28 while path\match '/([^/]-)/%.%./'
29 path = path\gsub '/([^/]-)/%.%./', '/'
28 while path\match '/([^/]-)/%.%.(%f[/\0])'
29 path = path\gsub '/([^/]-)/%.%.(%f[/\0])', '%2'
3030
3131 if origin.path == path\sub 1, #origin.path
3232 assert (origin\walk path), "couldn't resolve path '#{path}' from #{origin}"