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

Re: Is this a bug? Why not?



On 9 April 2010 16:37, Peter Stephenson <pws@xxxxxxx> wrote:
> On Thu, 01 Apr 2010 15:51:18 -0700
> Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>> On Apr 1,  2:57pm, Phil Pennock wrote:
>> } Subject: Re: Is this a bug? Why not?
>> }
>> } > E.g., why doesn't the following cause $foo to be quoted?
>> } >
>> } > schaefer[516] ARGV0=sh Src/zsh
>> } > $ foo="???"
>> } > $ print ${foo+"$foo"}
>> } > Doc Etc Src
>> } > $
>> } >
>> } > It works in bash.
>>
>> } Is this use-case important enough to warrant yet another option?
>>
>> Normally I'd be a stickler for not changing existing behavior, but in
>> this case it looks so obviously like a bug in the way glob_subst is
>> implemented that I'm not sure a new option is needed.
>
> I think that's correct.  It might be as simple as this.
>
> Index: Src/subst.c
> ===================================================================
> RCS file: /cvsroot/zsh/zsh/Src/subst.c,v
> retrieving revision 1.102
> diff -p -u -r1.102 subst.c
> --- Src/subst.c 27 Mar 2010 19:04:36 -0000      1.102
> +++ Src/subst.c 9 Apr 2010 14:34:26 -0000
> @@ -2417,7 +2417,7 @@ paramsubst(LinkList l, LinkNode n, char
>                multsub(&val, spbreak && !aspar, (aspar ? NULL : &aval), &isarr, NULL);
>                opts[SHWORDSPLIT] = ws;
>                copied = 1;
> -               spbreak = 0;
> +               spbreak = globsubst = 0;
>            }
>            break;
>        case ':':

This patch breaks at least cd ~-/<tab> and anything using _pids for
me. Reverting it on top of current cvs makes everything work again,
found with git bisect. Frank confirmed he has the same problems with a
recent build too.

-- 
Mikael Magnusson



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