From: Akim Demaille Date: Thu, 2 Nov 2000 17:35:53 +0000 (+0000) Subject: * doc/autoconf.texi (Limitations of Usual Tools): Some about X-Git-Tag: autoconf-2.50~479 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5243fda44e034ad8324ec32fa8e08faf8e372f25;p=thirdparty%2Fautoconf.git * doc/autoconf.texi (Limitations of Usual Tools): Some about dirname. --- diff --git a/ChangeLog b/ChangeLog index 83195cf2e..cc4298b98 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-11-02 Akim Demaille + + * doc/autoconf.texi (Limitations of Usual Tools): Some about + dirname. + 2000-11-02 Pavel Roskin * ifnames.sh: Put the opening brace on the same line with diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 7b87faec7..491d5c16f 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -5528,10 +5528,46 @@ $ gawk 'function die () @{ print "Aaaaarg!" @} Aaaaarg! @end example + @item @command{cat} @cindex @command{cat} Don't rely on any option. + +@item @command{dirname} +@cindex @command{dirname} +Not all hosts have @command{dirname}, but it is reasonably easy to +emulate, e.g.: + +@example +dir=`expr "x$file" : 'x\(.*\)/[^/]*' \| + '.' : '.' +@end example + +@noindent +But there are a few subtilities, e.g., under UN*X, should @samp{//1} +give @samp{/}? Paul Eggert answers: + +@quotation +No, under some older flavors of Unix, leading @samp{//} is a special +path name: it refers to a "super-root" and is used to access other +machines' files. Leading @samp{///}, @samp{////}, etc. are equivalent +to @samp{/}; but leading @samp{//} is special. I think this tradition +started with Apollo Domain/OS, an OS that is still in use on some older +hosts. + +POSIX.2 allows but does not require the special treatment for @samp{//}. +It says that the behavior of dirname on path names of the form +@samp{//([^/]+/*)?} is implementation defined. In these cases, GNU +@command{dirname} returns @samp{/}, but it's more portable to return +@samp{//} as this works even on those older flavors of Unix. + +I have heard rumors that this special treatment of @samp{//} may be +dropped in future versions of POSIX, but for now it's still the +standard. +@end quotation + + @item @command{egrep} @cindex @command{egrep} The empty alternative is not portable, use @samp{?} instead. For diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4 index e2b47a776..70cb29595 100644 --- a/lib/m4sugar/m4sh.m4 +++ b/lib/m4sugar/m4sh.m4 @@ -132,24 +132,6 @@ done; } # Simulate running `dirname(1)' on PATHNAME, not all systems have it. # This macro must be usable from inside ` `. # -# Paul Eggert answers: -# Question: Under UN*X, should `//1' give `/'? -# -# No, under some older flavors of Unix, leading // is a special path -# name: it refers to a "super-root" and is used to access other -# machines' files. Leading ///, ////, etc. are equivalent to /; but -# leading // is special. I think this tradition started with Apollo -# Domain/OS, an OS that is still in use on some older hosts. -# -# POSIX.2 allows but does not require the special treatment for //. -# It says that the behavior of dirname on path names of the form -# //([^/]+/*)? is implementation defined. In these cases, GNU dirname -# returns /, but it's more portable to return // as this works even on -# those older flavors of Unix. -# -# I have heard rumors that this special treatment of // may be dropped -# in future versions of POSIX, but for now it's still the standard. -# # Prefer expr to echo|sed, since expr is usually faster and it handles # backslashes and newlines correctly. However, older expr # implementations (e.g. SunOS 4 expr and Solaris 8 /usr/ucb/expr) have diff --git a/m4sh.m4 b/m4sh.m4 index e2b47a776..70cb29595 100644 --- a/m4sh.m4 +++ b/m4sh.m4 @@ -132,24 +132,6 @@ done; } # Simulate running `dirname(1)' on PATHNAME, not all systems have it. # This macro must be usable from inside ` `. # -# Paul Eggert answers: -# Question: Under UN*X, should `//1' give `/'? -# -# No, under some older flavors of Unix, leading // is a special path -# name: it refers to a "super-root" and is used to access other -# machines' files. Leading ///, ////, etc. are equivalent to /; but -# leading // is special. I think this tradition started with Apollo -# Domain/OS, an OS that is still in use on some older hosts. -# -# POSIX.2 allows but does not require the special treatment for //. -# It says that the behavior of dirname on path names of the form -# //([^/]+/*)? is implementation defined. In these cases, GNU dirname -# returns /, but it's more portable to return // as this works even on -# those older flavors of Unix. -# -# I have heard rumors that this special treatment of // may be dropped -# in future versions of POSIX, but for now it's still the standard. -# # Prefer expr to echo|sed, since expr is usually faster and it handles # backslashes and newlines correctly. However, older expr # implementations (e.g. SunOS 4 expr and Solaris 8 /usr/ucb/expr) have