Fix relative . or .. symlinks

This commit is contained in:
Nero 2018-03-20 18:03:13 +00:00
parent d54039a09b
commit 2665af78b6
1 changed files with 3 additions and 4 deletions

View File

@ -27,13 +27,12 @@ while [ -n "$left" ]; do
case "$seg" in
.)
# /foo/a -> . will become /foo
result="${result%/*}"
# Just ignore this segment
continue
;;
..)
# /foo/bar/a -> .. will become /foo
result="${result%/*/*}"
# Eat a segment off result
result="${result%/*}"
continue
;;
esac