From commits-return-12334-apmail-apr-commits-archive=apr.apache.org@apr.apache.org Tue Nov 8 02:50:14 2011 Return-Path: X-Original-To: apmail-apr-commits-archive@www.apache.org Delivered-To: apmail-apr-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E02D197FA for ; Tue, 8 Nov 2011 02:50:13 +0000 (UTC) Received: (qmail 76240 invoked by uid 500); 8 Nov 2011 02:50:13 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 76140 invoked by uid 500); 8 Nov 2011 02:50:13 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 76133 invoked by uid 99); 8 Nov 2011 02:50:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Nov 2011 02:50:12 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Nov 2011 02:50:10 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id A4C4A23888EA for ; Tue, 8 Nov 2011 02:49:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1199078 - /apr/apr/branches/1.4.x/build/apr_common.m4 Date: Tue, 08 Nov 2011 02:49:49 -0000 To: commits@apr.apache.org From: rjung@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111108024949.A4C4A23888EA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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