diff options
authorMichael Orlitzky <>2020-02-28 19:46:24 -0500
committerMichael Orlitzky <>2020-02-29 17:00:00 -0500
commita4c6e0989d1233ba475b0b890d9d084b113682be (patch)
tree5d958662d4f936b117a6ba8c0da88e9e86615f8d /src/
parentrespect ROOT env variable (diff)
src/ enable nullglob during find_targets().
While it didn't appear to hurt anything, the find_targets() function could output a literal "php*.*" when there were no valid PHP targets. Now the "nullglob" shell option is enabled during that function. Signed-off-by: Michael Orlitzky <>
Diffstat (limited to 'src/')
1 files changed, 5 insertions, 3 deletions
diff --git a/src/ b/src/
index a047c62..12ef1e1 100644
--- a/src/
+++ b/src/
@@ -246,10 +246,12 @@ update_sapi() {
# A space-separated list of target names, for example, "php5.6 php7.0".
find_targets() {
- # TODO: when there aren't any phpX.Y directories, this returns
- # "php*.*". This doesn't seem to bother our consumers, but it
- # would probably be more polite to return nothing in that case.
+ # Temporarily enable the "nullglob" shell option to ensure that we
+ # don't return a literal "php*.*" when there are no valid targets.
+ local shopt_nullglob_saved=$(shopt -p nullglob)
+ shopt -s nullglob
cd "${ROOT%/}@LIBDIR@" && echo php*.*
+ ${shopt_nullglob_saved}
# List all valid targets for the given SAPI. The list is obtained by