From e0772c12aeafb9b1b9274927024c15a9af1e9567 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Thu, 31 Jul 2025 00:30:43 +0200 Subject: [PATCH] minimal/do: Do not fail with bash 5.3 When running "make test" with bash 5.3, it fails with: minimal/do: line 358: cd: null directory ./do: minimal/do test failed make: *** [Makefile:10: test] Error 42 The reason is that bash 5.3 implements the latest version of the POSIX standard, which requires that "cd" with an empty string should fail. Specifically, "If directory is an empty string, cd shall write a diagnostic message to standard error and exit with non-zero status." [1]. This is documented at [2]. Fix that by substituting an empty string with ".", which is already being done at other places in the that script. [1]: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/cd.html [2]: https://cgit.git.savannah.gnu.org/cgit/bash.git/tree/CHANGES?h=bash-5.3#n119. --- minimal/do | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/minimal/do b/minimal/do index 557c433..7c165c8 100755 --- a/minimal/do +++ b/minimal/do @@ -355,7 +355,7 @@ _do() fi target=$PWD/$target tmp=$PWD/$tmp - cd "$dodir" || return 99 + cd "${dodir:-.}" || return 99 target=$(_relpath "$target" "$PWD") || return 98 tmp=$(_relpath "$tmp" "$PWD") || return 97 base=${target%$ext}