On Tue, Mar 27, 2012 at 12:28:04PM -0500, Yarin <[email protected]> wrote:
> http://www.open-std.org/jtc1/sc22/wg14/www/docs/n869/
> Section 7.20.8.1.4, specifies that the null termination
> is indeed optional. While I agree that it probably would
Neither that document nor the official standard say that it is optional, I
have no clue what you were reading even: 7.20.8.1 §2 says:
No multibyte characters that follow a null character (which
is converted into a code with value zero) will be examined or
converted.
0 gets converted to 0, nothing optional or implementation-defined here.
§4 doesn't say anything about 0-termination, except that the string will
not be 0-terminated if it doesn't fit, which is, again, not optional (or
implementation-defined) behaviour but required behaviour.
It also doesn't apply, because urxvt passes strlen (input) + 1, and there
cannot be more than one wchar per input octet (again, as per ISO C).
Implementations are not free to implement any optional behaviour regarding
0-termination, the behaviour has to be implemented exactly as specified,
unless notes otherwise.
> implimented behavior does still conform to the standard
Maybe, but not to ISO-C 90, C99, UNIX, whcih are all required by urxvt.
> (unless, of course, C89 & C99 differ on this point).
They do differ, because C89 didn't have mbstowcs - that was added in C90
only (could be wrong here, though, I didn't check). But of course, when
people say C89 they often mean C90.
> So _technically_, the bug does lie in URxvt.
Only by wishful thinking. There might be a bug in urxvt in that code, but
this one does not.
Do us a favour and report it to the openbsd devs, so they ahve a chance of
fixing their libc (or maybe document that they do not implement ISO C or
the iso 10646 option).
--
The choice of a Deliantra, the free code+content MORPG
-----==- _GNU_ http://www.deliantra.net
----==-- _ generation
---==---(_)__ __ ____ __ Marc Lehmann
--==---/ / _ \/ // /\ \/ / [email protected]
-=====/_/_//_/\_,_/ /_/\_\
_______________________________________________
rxvt-unicode mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/rxvt-unicode