magicant / yash

Yet another shell
http://magicant.github.io/yash/
GNU General Public License v2.0
301 stars 28 forks source link

fsplit-p.tst: export IFS influences run-test.sh #50

Closed sertonix closed 2 months ago

sertonix commented 2 months ago

When the fsplit-p.tst exports IFS this variable also effects run-test.sh. https://github.com/magicant/yash/blob/f5bbaad8b751dc16357cf6e5466a98d680d29338/tests/fsplit-p.tst#L14 run-test.sh assumes the default IFS to correctly split diff_opt. https://github.com/magicant/yash/blob/f5bbaad8b751dc16357cf6e5466a98d680d29338/tests/run-test.sh#L311 https://github.com/magicant/yash/blob/f5bbaad8b751dc16357cf6e5466a98d680d29338/tests/run-test.sh#L331

With the changed IFS -U 10000 is passed as a single argument to diff (and not split as normally). The diff implementation of coreutils ignores this error but the one from busybox is more strict.

IFS should probably be unset before word splitting is used in run-test.sh.

magicant commented 2 months ago

Nice catch, thanks.

sertonix commented 2 months ago

I used this patch for the alpine linux package. Don't know if there is a better way.

--- a/tests/run-test.sh
+++ b/tests/run-test.sh
@@ -305,6 +305,8 @@ testcase() {
             ;;
     esac

+    unset -v IFS
+
     # check standard output
     if { <&4; } 2>/dev/null; then
         printf '%% standard output diff:\n'