From 9a71068cf03f565d93812d1d79194129bf48cb99 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ga=C3=ABl=20Bonithon?= <gael@xfce.org>
Date: Sat, 29 Jan 2022 09:18:20 +0100
Subject: [PATCH] xdt-autogen: Fallback on `\n` as IFS if `\1` is not supported

Fixes #54.
---
 scripts/xdt-autogen.in | 6 ++++++
 1 file changed, 6 insertions(+)

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
 ##
-- 
GitLab