Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: global alias with leading space gives unexpected thing



On Wed, 28 Apr 2010 00:02:00 +0200
Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> Maybe something like this is needed?
> 
> diff --git a/Src/lex.c b/Src/lex.c
> index 8f43251..83257da 100644
> --- a/Src/lex.c
> +++ b/Src/lex.c
> @@ -1774,7 +1774,7 @@ exalias(void)
>                 if (an && !an->inuse &&
>                     ((an->node.flags & ALIAS_GLOBAL) || incmdpos ||
> inalmore)) { inpush(an->text, INP_ALIAS, an);
> -                   if (an->text[0] == ' ')
> +                   if (an->text[0] == ' ' && !(an->node.flags &
> ALIAS_GLOBAL)) aliasspaceflag = 1;
>                     lexstop = 0;
>                     if (zshlextext == copy)

Yes, it's surely an oversight when it happens with global aliases.  I've
added this and noted it in the documentation.

-- 
Peter Stephenson <pws@xxxxxxx>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom



Messages sorted by: Reverse Date, Date, Thread, Author