[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/3] AC_SITE_LOAD: Convert '\' in PATH to '/' on OS/2
From: |
KO Myung-Hun |
Subject: |
[PATCH 1/3] AC_SITE_LOAD: Convert '\' in PATH to '/' on OS/2 |
Date: |
Fri, 7 Nov 2014 23:40:20 +0900 |
echo of some shells such as pdksh recognizes '\' as an escape
character. So when echoing a path, the result can be corrupted. For
examples, echo x:\usr\bin will be x:\usin.
* lib/autoconf/general.m4 (AC_SITE_LOAD): Convert '\' in PATH to '/'
on OS/2.
---
lib/autoconf/general.m4 | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index 59d204f..c18b162 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -1951,6 +1951,27 @@ do
|| AC_MSG_FAILURE([failed to load site script $ac_site_file])
fi
done
+
+if test -n "$OS2_SHELL"; then
+ # Backslashes into forward slashes:
+ # The following OS/2 specific code is performed AFTER config.site
+ # has been loaded to allow users to change their environment there.
+ # This strange code is necessary to deal with handling of backslashes by
+ # ksh.
+ ac_save_IFS="$IFS"
+ IFS="\\"
+ ac_TEMP_PATH=
+ for ac_dir in $PATH; do
+ IFS=$ac_save_IFS
+ if test -z "$ac_TEMP_PATH"; then
+ ac_TEMP_PATH="$ac_dir"
+ else
+ ac_TEMP_PATH="$ac_TEMP_PATH/$ac_dir"
+ fi
+ done
+ export PATH="$ac_TEMP_PATH"
+ unset ac_TEMP_PATH
+fi
])
--
1.8.5.2