2006-03-31 Paul Eggert <eggert@cs.ucla.edu>
+ * doc/autoconf.texi (Programming in M4sh): Sharpen the descriptions
+ of AS_BASENAME and AS_DIRNAME. Reported by Stepan Kasal.
+
* lib/m4sugar/m4sh.m4 (AS_BASENAME_EXPR): Handle ///, ////, etc.
correctly. Problem reported by Eric Blake.
(_AS_EXPR_PREPARE): Detect Tru64 expr bug. Problem reported by
@defmac AS_BASENAME (@var{file-name})
@asindex{BASENAME}
Output the non-directory portion of @var{file-name}. For example,
-@code{file=`AS_BASENAME([/one/two/three])`} sets @code{file} to
-@samp{three}. @xref{Limitations of Usual Tools}, for why this is more
-portable than @command{file=`basename /one/two/three`}.
+if @code{$file} is @samp{/one/two/three}, the command
+@code{base=`AS_BASENAME(["$file"])`} sets @code{base} to @samp{three}.
@end defmac
@defmac AS_BOURNE_COMPATIBLE
@defmac AS_DIRNAME (@var{file-name})
@asindex{DIRNAME}
Output the directory portion of @var{file-name}. For example,
-@code{file=`AS_DIRNAME([/one/two/three])`} sets @code{file} to
-@samp{/one/two}. @xref{Limitations of Usual Tools}, for why this is
-more portable than @command{file=`dirname /one/two/three`}.
+if @code{$file} is @samp{/one/two/three}, the command
+@code{dir=`AS_DIRNAME(["$file"])`} sets @code{dir} to @samp{/one/two}.
@end defmac
@defmac AS_IF (@var{test1}, @ovar{run-if-true1}, @dots{}, @ovar{run-if-false})