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

Empty [(I)...] subscripting of assoc arrays (was Re: PATCH: completion)



I think we now have entirely too many topics going on that all have the
subject "Re: PATCH: completion".

On Aug 23,  2:00pm, Sven Wischnowsky wrote:
} Subject: Re: PATCH: completion
}
} > This is because "-a" in compadd arguments. It is the result of
} > expansion of "dopts[${(@)^dopts[(I)${ws[1][1]}[$uns]]}]" and
} > "odopts[${(@)^odopts[(I)${ws[1][1]}[$uns]]}]".
} 
} Ah, sorry, I didn't test it with `[(I)...]'. So I think this is a real 
} bug, to be fixed in C. I'd like to hear Bart about this, though,
} because there was explicit code to turn empty array-subscripts into
} non-arrays. Maybe the effect this had on associations subscripted with 
} `[(I)...]' and `[(R)...]' was pure oversight, though.

It was oversight in that I didn't consider it; but either the patch you
sent is correct or else it's going to cause a core dump at subst.c:1713 

	    i = 1;
	    /* aval[1] is non-null here */
	    while (aval[i + 1]) {

in some circumstances that I'm not able to predict offhand.  I tend to
think it'll be OK.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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