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

Re: Quoting problem and crashes with ${(#)var}



On Feb 26, 10:34am, Peter Stephenson wrote:
} Subject: Re: Quoting problem and crashes with ${(#)var}
}
} Bart Schaefer wrote:
} > +	    strcpy(buf, nicechar((int)c));
} > +	    if (widthp)
} > +		*widthp = strlen(buf);
} 
} If printeightbit is set, then nicechar() may pass 8-bit characters,
} which may be metafied, straight through, so ztrlen() is probably better.
} printeightbit doesn't guaranteed to get character lengths right, but
} counting metafied characters as 1 is more consistent.

That may be more consistent, but a bit later on the same function computes
(*swidep = buf + *widthp) so I think what's wanted here is the actual
width rather than the visible width.

} I don't think we need to take account of wide characters here; we don't
} have the information for that in this branch of the code.

I'm more worried about embedded nuls, really, but that should be OK.  I'll
go ahead and commit it as above.



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