[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Please normalize command line paths
From: |
Paul Eggert |
Subject: |
Re: Please normalize command line paths |
Date: |
Fri, 05 Oct 2007 13:53:06 -0700 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) |
Eric Blake <address@hidden> writes:
> + # Remove trailing slashes.
> + case $ac_val in
> + / | // ) ;;
> + */ ) eval $ac_var='`echo "$ac_val" | sed "s|/*\$||"`' ;;
> + esac
This mishandles ///, no? Also, 'expr' is more reliable in the
presence of weird characters, such as backslashes. I installed this:
2007-10-05 Paul Eggert <address@hidden>
* lib/autoconf/general.m4 (_AC_INIT_PARSE_ARGS): Handle "///"
correctly.
diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index 0f8a5dc..10df399 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -904,8 +904,9 @@ do
eval ac_val=\$$ac_var
# Remove trailing slashes.
case $ac_val in
- / | // ) ;;
- */ ) eval $ac_var='`echo "$ac_val" | sed "s|/*\$||"`' ;;
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[[^/]]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
esac
# Be sure to have absolute directory names.
case $ac_val in