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:
parent
262d272f29
commit
b08b5efcef
2 changed files with 10 additions and 1 deletions
|
|
@ -46,6 +46,15 @@ quiet_stderr()
|
|||
fi
|
||||
}
|
||||
|
||||
(
|
||||
x="/a/b/c/"
|
||||
IFS=/
|
||||
f() {
|
||||
[ "$2" = "a" ] || fail 2
|
||||
[ "$#" = "4" ] || warn 2a
|
||||
}
|
||||
f $x
|
||||
)
|
||||
|
||||
name=foo.o.o
|
||||
ext=.o
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue