From 809b3e5353f4091e55a8cd918af31309e40b3d1c Mon Sep 17 00:00:00 2001 From: Stepan Kasal Date: Tue, 13 May 2008 13:40:55 -0600 Subject: [PATCH] Work around MSYS and Cygwin bugs when dealing with trailing space. * tests/atlocal.in (func_sanitize_dir_name): Let atlocal succeed, even when platform bugs are tickled. Reported by Keith Marshall and Eric Blake. --- ChangeLog | 7 +++++++ tests/atlocal.in | 17 +++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5af9cd02..dc027241 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-05-13 Stepan Kasal + + Work around MSYS and Cygwin bugs when dealing with trailing space. + * tests/atlocal.in (func_sanitize_dir_name): Let atlocal succeed, + even when platform bugs are tickled. + Reported by Keith Marshall and Eric Blake. + 2008-05-12 Ralf Wildenhues Let AC_MSG_FAILURE report pwd. diff --git a/tests/atlocal.in b/tests/atlocal.in index baef9868..ad72c374 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -44,11 +44,12 @@ else fi # Can we create directories with trailing whitespaces in their name? -rm -rf 'tdir /' -mkdir 'tdir ' && touch 'tdir /tfile' 2>/dev/null -if test -f 'tdir /tfile'; then - func_sanitize_dir_name () { echo "$@"; } -else - func_sanitize_dir_name () { echo "$@" | sed 's/ *$//'; } -fi -rm -rf 'tdir /' +rm -rf 'tdir ' && mkdir 'tdir ' && touch 'tdir /tfile' 2>/dev/null +a=$? +rm -rf 'tdir ' +case $a$? in #( +00) + func_sanitize_dir_name () { echo "$@"; } ;; #( +*) + func_sanitize_dir_name () { echo "$@" | sed 's/ *$//'; } ;; +esac