From 3e57d589334d7fd3ad08cba5114f163e267a937b Mon Sep 17 00:00:00 2001 From: "Hans Krentel (hakre)" Date: Thu, 7 Nov 2024 18:49:58 +0100 Subject: [PATCH] Fail early in *nix build script Adding one more [1] exit early safeguard in *nix build scripts: Given the initial cd into the build tree fails (the project root), the `buildconf` script exits with non-zero status (failure). Additionally quoting the pathname to cd into and the empty CD_PATH parameter for portability, also for systems that are using a non-portable pathname [2] for the build tree. [1]: https://github.com/php/php-src/pull/16717 [2]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_271 --- ext/fileinfo/generate_patch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/fileinfo/generate_patch.sh b/ext/fileinfo/generate_patch.sh index da99b1fcdb2af..4e3fade8ec566 100755 --- a/ext/fileinfo/generate_patch.sh +++ b/ext/fileinfo/generate_patch.sh @@ -3,7 +3,7 @@ VERSION=5.45 # Go to fileinfo extension directory. -cd $(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P) +cd "$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)" || exit if [ ! -d libmagic.orig ]; then mkdir libmagic.orig