[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: proposed autoconf patches for AS_BASENAME, AS_DIRNAME
From: |
Paul Eggert |
Subject: |
Re: proposed autoconf patches for AS_BASENAME, AS_DIRNAME |
Date: |
Thu, 18 Oct 2001 16:46:39 -0700 (PDT) |
> From: Akim Demaille <address@hidden>
> Date: 08 Oct 2001 13:57:21 +0200
> +[(dirname [$1]) 2>/dev/null ||
>
> +[(basename [$1]) 2>/dev/null ||
>
> You are double quoting here. Should be (dirname $1)
OK, I checked it in with the above change. Testing revealed that
one of our test cases was too enthusiastic, so I also checked in this
change:
2001-10-18 Paul Eggert <address@hidden>
* tests/m4sh.at (DIRNAME_TEST): New arg $3.
Allow "dirname //FOO" to return either / or //, as POSIX allows
either behavior.
Index: tests/m4sh.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/m4sh.at,v
retrieving revision 1.24
diff -p -u -r1.24 m4sh.at
--- tests/m4sh.at 2001/10/08 08:21:54 1.24
+++ tests/m4sh.at 2001/10/18 23:25:06
@@ -100,27 +100,28 @@ AT_DATA_M4SH([script.as],
# weak for us, in which case `as_expr=false'.
m4_define([DIRNAME_TEST],
[dir=`AS_DIRNAME([$1])`
-test "$dir" = "$2" ||
+test "$dir" = "$2" || (test -n "$3" && test "$dir" = "$3") ||
echo "dirname($1) = $dir instead of $2" >&2
if test "$as_expr" != false; then
dir=`AS_DIRNAME_EXPR([$1])`
- test "$dir" = "$2" ||
+ test "$dir" = "$2" || (test -n "$3" && test "$dir" = "$3") ||
echo "dirname_expr($1) = $dir instead of $2" >&2
fi
dir=`AS_DIRNAME_SED([$1])`
test "$dir" = "$2" ||
+test "$dir" = "$2" || (test -n "$3" && test "$dir" = "$3") ||
echo "dirname_sed($1) = $dir instead of $2" >&2])
DIRNAME_TEST([/], [/])
-DIRNAME_TEST([//], [//])
+DIRNAME_TEST([//], [//], [/])
DIRNAME_TEST([///], [/])
-DIRNAME_TEST([//1], [//])
+DIRNAME_TEST([//1], [//], [/])
DIRNAME_TEST([/1], [/])
DIRNAME_TEST([./1], [.])
DIRNAME_TEST([../../2], [../..])
-DIRNAME_TEST([//1/], [//])
+DIRNAME_TEST([//1/], [//], [/])
DIRNAME_TEST([/1/], [/])
DIRNAME_TEST([./1/], [.])
DIRNAME_TEST([../../2], [../..])