You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by rj...@apache.org on 2011/11/08 03:44:21 UTC

svn commit: r1199072 - /apr/apr/trunk/build/apr_common.m4

Author: rjung
Date: Tue Nov  8 02:44:21 2011
New Revision: 1199072

URL: http://svn.apache.org/viewvc?rev=1199072&view=rev
Log:
BZ 50334: Change back fix for APR_RESTORE_THE_ENVIRONMENT
to sed use, because ${A#B} is not available in all shells,
especially not in /bin/sh on Solaris.

The original problem of only whitespace in the saved
variable is fixed by a better test condition.

The additional possible problem of sed or regexp meta
characters in the variable value is still open but
yet has to be observed in the wild.

Modified:
    apr/apr/trunk/build/apr_common.m4

Modified: apr/apr/trunk/build/apr_common.m4
URL: http://svn.apache.org/viewvc/apr/apr/trunk/build/apr_common.m4?rev=1199072&r1=1199071&r2=1199072&view=diff
==============================================================================
--- apr/apr/trunk/build/apr_common.m4 (original)
+++ apr/apr/trunk/build/apr_common.m4 Tue Nov  8 02:44:21 2011
@@ -202,14 +202,18 @@ dnl and restoring the original variable 
 dnl for a user to override configure when it does something stupid.
 dnl
 AC_DEFUN([APR_RESTORE_THE_ENVIRONMENT], [
-if test "x$apr_ste_save_$1" = "x"; then
+dnl Check whether $apr_ste_save_$1 is empty or
+dnl only whitespace. The verbatim "X" is token number 1,
+dnl the following whitespace will be ignored.
+set X $apr_ste_save_$1
+if test ${#} -eq 1; then
   $2$1="$$1"
   $1=
 else
   if test "x$apr_ste_save_$1" = "x$$1"; then
     $2$1=
   else
-    $2$1="${$1#"${apr_ste_save_$1}"}"
+    $2$1=`echo "$$1" | sed -e "s%${apr_ste_save_$1}%%"`
     $1="$apr_ste_save_$1"
   fi
 fi