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

Re: Bug: bracketed-paste-magic + ztcp causes wrong pasted contents for CJK payloads



On Tue, 27 Oct 2015 20:23:40 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> AHA!
> 
> tcp.c uses setiparam("REPLY"), so depending on whether $REPLY is already
> defined or not, it gets initialized as an integer-typed variable, which
> means that when "self-insert" is assigned to REPLY, it's treated as an
> arithmetic expression and evaluates to 0.

I even noticed this the other day and got confused by it when playing
with ztcp myself, and nearly mentioned it.

I suspect the biggest problem is when you do stuff from the command line,
but it can obviously turn up anywhere.

> tcp.c, socket.c, and zpty.c all use setiparam("REPLY"), potentially
> inflicting this on other modules that later do setsparam("REPLY").  Yet
> another reason for Kurtis to run for the hills.

Or you could interpret it as a reason for warncreateglobal.  Does that
go off correctly if you set it?  If not, we might want to try to get it
to, even if we take the setitparam()s out.

I'd be inclined to get rid of this.  There's no good reason for using an
integer parameter for something that doesn't need to be involved in
arithmetic evaluation at all as it's going to spend its life just as a
number of no more than a couple of digits.

pws



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