Hi Eric,
* Eric Blake wrote on Thu, Oct 09, 2008 at 11:10:53PM CEST:
>
> as_func_basename ()
> {
> test "x$1" = "x--" && shift
> case $1 in
> / | // ) result=$1 ;; # root dir corner cases
> *[!/]*/ ) # trailing slash, but not root
> result=${1##*[!/]} # compute the suffix of slashes
> result=${1%"$result"} # strip the trailing slashes
> result=${result##*/} ;; # compute the basename
> */ ) result=/ ;; # collapse alternate spelling of root
> * ) result=${result##*/} ;; # no trailing slash
> esac
> # add code here for stripping $2, if wanted
> }
What if \ also serves as directory separator? Are you going to rule
that out for the new AS_BASENAME?
Cheers,
Ralf