t/shelltest.od: Add a new preliminary test for IFS= behaviour.

Apparently in zsh (when in sh compatibility mode), IFS=/ will split
"/a/b/c/" into 5 parts ("", "a", "b", "c", ""). Other shells all seem
to agree that it's 4 parts ("", "a", "b", "c"). zsh seems maybe more
correct to me, but the majority rules, so we'll warn on it.

Meanwhile, we'll also fix the one place in minimal/do that failed due
to this oddity, since it's relatively easy to avoid.

Reported-by: shamrin@gmail.com
This commit is contained in:
Avery Pennarun 2019-07-24 02:45:47 -04:00
commit b08b5efcef
2 changed files with 10 additions and 1 deletions

View file

@ -196,7 +196,7 @@ _normpath()
fi
set -f
IFS=/
for d in $path; do
for d in ${path%/}; do
#echo "NP out='$out' d='$d'" >&2
if [ "$d" = ".." ]; then
out=$(_updir "${out%/}")/