[PATCH 1/2] AC_SITE_LOAD: convert '\' in PATH to '/' on OS/2

KO Myung-Hun <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.patches
Message-ID <[email protected]>
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 | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index a7f1439..6173b83 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -1951,6 +1951,15 @@ 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.
+  export PATH=$(expr "$PATH" | tr '\\' /)
+fi
 ])
 
 
-- 
1.9.5
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.