our mbrtowc(3) is not in conformance to POSIX specification

Issue #11 closed
Takehiko NOZAKI repo owner created an issue

opengroup's specfication says:

If s is a null pointer, the mbrtowc() function shall be equivalent to the call: mbrtowc(NULL, "", 1, ps)

but our implementation force to initialize the mbstate_t(=ps) incorrectly.

Comments (9)

  1. Takehiko NOZAKI reporter
    • changed status to open

    reopen, this fix causes sysinstall trouble, sysinstall don't show any chatacter after setect language and call setlocale(3) internally.

  2. Takehiko NOZAKI reporter

    this sysinstall bug introduced by _fixup_ps() change. the _RuneLocale embedded in mbstate_t is not same as current locale, raise EINVAL.

    but this change give impact on some i18n'ed application/library(ex. sysinstall/libcurses). so i simply change:

    1. don't throw EINVAL.
    2. initialize mbstate_t silently.
  3. Takehiko NOZAKI reporter

    BUGFIX: Issue #11 our mbrtowc(3) is not in conformance to POSIX specification.

    previous fix causes sysinstall trouble, sysinstall don't show any chatacters after setect language and call setlocale(3) internally.

    this sysinstall bug introduced by _fixup_ps() change. the _RuneLocale embedded in mbstate_t is not same as current locale, raise EINVAL.

    but this change give impact on some i18n'ed application/library(ex. sysinstall/libcurses). so i simply change:

    1. don't throw EINVAL.
    2. initialize mbstate_t silently.

    → <<cset f0187947a8b4>>

  4. Log in to comment