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:49:49 UTC

svn commit: r1199078 - /apr/apr/branches/1.4.x/build/apr_common.m4

Author: rjung
Date: Tue Nov  8 02:49:49 2011
New Revision: 1199078

URL: http://svn.apache.org/viewvc?rev=1199078&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.

Backport of r1199072 from trunk and r1199076 from 1.5.x.

Modified:
    apr/apr/branches/1.4.x/build/apr_common.m4

Modified: apr/apr/branches/1.4.x/build/apr_common.m4
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.4.x/build/apr_common.m4?rev=1199078&r1=1199077&r2=1199078&view=diff
==============================================================================
--- apr/apr/branches/1.4.x/build/apr_common.m4 (original)
+++ apr/apr/branches/1.4.x/build/apr_common.m4 Tue Nov  8 02:49:49 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