[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AC_PREFIX_PATH, AS_BASENAME fixes and a new test!
From: |
Tim Van Holder |
Subject: |
Re: AC_PREFIX_PATH, AS_BASENAME fixes and a new test! |
Date: |
Tue, 18 Sep 2001 11:16:08 +0200 |
> The AS_BASENAME fix doesn't seem complete to me.
> AS_BASENAME should look like AS_DIRNAME, e.g. something like this:
>
> # AS_BASENAME(PATHNAME)
> # --------------------
> # Simulate running `basename(1)' on PATHNAME, not all
> systems have it.
> # Also see the comments for AS_DIRNAME.
> m4_defun([AS_BASENAME_EXPR],
> [m4_require([_AS_EXPR_PREPARE])dnl
> $as_expr X[]$1 : '.*/\([^/][^/]*\)/*$' \| \
> X[]$1 : '\([^/][^/]*\)/*$' \|
> X[]$1 : 'X\(//\)$' \| \
> X[]$1 : 'X\(/\)/*$' \| \
> . : '\(.\)'])
>
> m4_defun([AS_BASENAME_SED],
> [echo X[]$1 |
> sed ['???']])
>
> m4_defun([AS_BASENAME],
> [AS_BASENAME_EXPR([$1]) 2>/dev/null ||
> AS_BASENAME_SED([$1])])
>
> except you need to fill in the '???'.
Plus you'd want to use [\\/] matchers for the directory separator in
order to support DOS paths (something currently lacking in AS_DIRNAME
too, I believe).
- AC_PREFIX_PATH, AS_BASENAME fixes and a new test!, Paul Wagland, 2001/09/17
- AC_PREFIX_PATH, AS_BASENAME fixes and a new test!, Paul Wagland, 2001/09/17
- Re: AC_PREFIX_PATH, AS_BASENAME fixes and a new test!, Akim Demaille, 2001/09/17
- Re: AC_PREFIX_PATH, AS_BASENAME fixes and a new test!, Paul Eggert, 2001/09/17
- Re: AC_PREFIX_PATH, AS_BASENAME fixes and a new test!, Akim Demaille, 2001/09/18
- Re: AC_PREFIX_PATH, AS_BASENAME fixes and a new test!, Paul Eggert, 2001/09/18
Re: AC_PREFIX_PATH, AS_BASENAME fixes and a new test!, Paul Eggert, 2001/09/17
RE: AC_PREFIX_PATH, AS_BASENAME fixes and a new test!, Paul Wagland, 2001/09/19
Re: AC_PREFIX_PATH, AS_BASENAME fixes and a new test!, Paul Eggert, 2001/09/19
Re: AC_PREFIX_PATH, AS_BASENAME fixes and a new test!, Akim Demaille, 2001/09/22