Skip to content

Commit 329890c

Browse files
hakrecmb69
authored andcommitted
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]: php#16717 [2]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_271 Closes phpGH-16724.
1 parent 257387b commit 329890c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/fileinfo/generate_patch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
VERSION=5.45
44

55
# Go to fileinfo extension directory.
6-
cd $(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
6+
cd "$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)" || exit
77

88
if [ ! -d libmagic.orig ]; then
99
mkdir libmagic.orig

0 commit comments

Comments
 (0)