summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaël Bonithon <gael@xfce.org>2022-01-29 09:18:20 +0100
committerGaël Bonithon <gael@xfce.org>2022-01-29 09:24:48 +0100
commit9a71068cf03f565d93812d1d79194129bf48cb99 (patch)
tree5f31bc706673736a582c91b1a97250b5d067e72e
parentbb06a93ddc609ffe587aaccc1e9929461c30ff51 (diff)
downloadxfce4-dev-tools-9a71068cf03f565d93812d1d79194129bf48cb99.tar.gz
xdt-autogen: Fallback on `\n` as IFS if `\1` is not supported
Fixes #54.
-rw-r--r--scripts/xdt-autogen.in6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/xdt-autogen.in b/scripts/xdt-autogen.in
index abbf5c8..ddc7c99 100644
--- a/scripts/xdt-autogen.in
+++ b/scripts/xdt-autogen.in
@@ -41,6 +41,12 @@ m4macrodir="${datarootdir}/aclocal"
default_IFS=$IFS
special_IFS=$(printf '\1')
+# fallback on '\n' if '\1' isn't well supported: it is POSIX, but e.g. bash 3.2.57
+# on macOS doesn't support it
+IFS=$special_IFS
+[ x$IFS = x ] || special_IFS=$(printf '\n')
+IFS=$default_IFS
+
##
## a few portability tests
##