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

Re: [PATCH] Make typeset -p1 work in combination with -m.



On Thu, 19 Oct 2017 18:24:11 +0000
Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:

> Daniel Shahaf wrote on Thu, 19 Oct 2017 14:40 +0000:
> > Peter Stephenson wrote on Wed, Oct 18, 2017 at 09:31:19 +0100:
> > > On Tue, 17 Oct 2017 18:27:00 +0000
> > > Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> > > > The PRINT_INCLUDEVALUE codepath will now pass
> > > > PRINT_LINE|PRINT_TYPESET|PRINT_INCLUDEVALUE; is that correct?
> > > 
> > > Yes, as long as the resulting output makes sense the flag can be passed
> > > through.
> > 
> > Ack.  I'll double check the output before pushing.
> 
> There's an unwanted output change:
> 
> before% typeset -m argv
> argv=(  )
> 
> after% typeset -m argv
> array argv

That can only be this chunk at the end of printparamnode() --- there's
nowhere else where we deal with the value.  So something you've done has
changed the result of that first test.  You'll probably just have to
step through and look at what's happening here.

pws

    if ((printflags & PRINT_NAMEONLY) ||
	((p->node.flags & PM_HIDEVAL) && !(printflags & PRINT_INCLUDEVALUE))) {
	zputs(p->node.nam, stdout);
	putchar('\n');
    } else {
	if (printflags & PRINT_KV_PAIR) {
	    if (printflags & PRINT_LINE)
		printf("\n  ");
	    putchar('[');
	}
	quotedzputs(p->node.nam, stdout);
	if (printflags & PRINT_KV_PAIR)
	    printf("]=");

	printparamvalue(p, printflags);
    }



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