autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sh problems


From: Assar Westerlund
Subject: sh problems
Date: 27 Jan 2001 05:52:49 +0100
User-agent: Gnus/5.070098 (Pterodactyl Gnus v0.98) Emacs/20.6

In _AS_TEST_PREPARE, we might end up echoing errors from non-working
test commands to the user which is confusing (at least to me).

A more serious problem is in AS_MKDIR_P.  It sets IFS to '\\/' and it
seems that some sh:s (which are probably really ksh:s) will use the
first character (backslash) when joining the components in "$@" and
then re-interpret (!) the backslash escapes, so you can end up with
backspace and other strange characters.  And you will end up with
directories called foo\bar and foo?az and others.  Changing the order
of the separators seems to fix it for me and I don't see that it
should have any negatives effects.  A patch and changelog entries for
both of these appear below.

/assar

2001-01-27  Assar Westerlund  <address@hidden>

        * m4sh.m4 (_AS_TEST_PREPARE): discard output when testing `test
        -x' and `test -f' to avoid confusing users with error messages
        (AS_MKDIR_P): invert order of separators in IFS to avoid problem
        with some shells adding backslash between fields and parsing the
        result for escapes

Index: m4sh.m4
===================================================================
RCS file: /cvs/autoconf/m4sh.m4,v
retrieving revision 1.28
diff -u -w -u -w -r1.28 m4sh.m4
--- m4sh.m4     2001/01/24 08:24:44     1.28
+++ m4sh.m4     2001/01/27 04:47:39
@@ -322,7 +322,7 @@
   *)                      ac_incr_dir=.;;
 esac
 ac_dummy=$1
-for ac_mkdir_dir in `IFS='\\/'; set X $ac_dummy; shift; echo 
"address@hidden"`; do
+for ac_mkdir_dir in `IFS='/\\'; set X $ac_dummy; shift; echo 
"address@hidden"`; do
   case $ac_mkdir_dir in
     # Skip DOS drivespec
     ?:) ac_incr_dir=$ac_mkdir_dir ;;
@@ -347,9 +347,9 @@
 exit 0
 _ASEOF
 chmod +x conftest.file
-if test -x conftest.file; then
+if test -x conftest.file >/dev/null 2>&1; then
   as_executable_p="test -x"
-elif test -f conftest.file; then
+elif test -f conftest.file >/dev/null 2>&1; then
   as_executable_p="test -f"
 else
   AS_ERROR([cannot check whether a file is executable on this system])



reply via email to

[Prev in Thread] Current Thread [Next in Thread]