mirror of git://sourceware.org/git/glibc.git
Update.
* wcsmbs/mbrtowc.c: Set flush to 1 for conversion function calls depending on whether the input string is empty or not. * wcsmbs/mbrtowc.c: Calling function without input means clearing the given state and not avoiding this by modifying a local object. * wcsmbs/wcrtomb.c: Likewise. * iconv/skeleton.c: If no EMIT_SHIFT_TO_INIT is defined clear state object since some incomplete characters might be in there.
This commit is contained in:
parent
777e222ddb
commit
f1f1b6b95a
10
ChangeLog
10
ChangeLog
|
|
@ -1,5 +1,15 @@
|
||||||
2000-06-28 Ulrich Drepper <drepper@redhat.com>
|
2000-06-28 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* wcsmbs/mbrtowc.c: Set flush to 1 for conversion function calls
|
||||||
|
depending on whether the input string is empty or not.
|
||||||
|
|
||||||
|
* wcsmbs/mbrtowc.c: Calling function without input means clearing the
|
||||||
|
given state and not avoiding this by modifying a local object.
|
||||||
|
* wcsmbs/wcrtomb.c: Likewise.
|
||||||
|
|
||||||
|
* iconv/skeleton.c: If no EMIT_SHIFT_TO_INIT is defined clear state
|
||||||
|
object since some incomplete characters might be in there.
|
||||||
|
|
||||||
* iconvdata/euc-jp.c: In conversion to UCS4, handling invalid
|
* iconvdata/euc-jp.c: In conversion to UCS4, handling invalid
|
||||||
sequences with first by 0x8e correctly.
|
sequences with first by 0x8e correctly.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
2000-06-28 Ulrich Drepper <drepper@redhat.com>
|
2000-06-28 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* tests-mbwc/dat_mbrlen.c: Correct some tests. Remove old WAIVER
|
||||||
|
comments.
|
||||||
|
* tests-mbwc/tst_mbrlen.c: Enable code to respect t_ini. Also clear
|
||||||
|
internal state of mbrlen.
|
||||||
|
|
||||||
* Makefile (do-tst-ctype): Add do-tst-mbswcs to list of dependencies.
|
* Makefile (do-tst-ctype): Add do-tst-mbswcs to list of dependencies.
|
||||||
(TEST_MBWC_ENV): Remove unnecessary slash.
|
(TEST_MBWC_ENV): Remove unnecessary slash.
|
||||||
* tst-ctype.sh: Add de_DE.UTF-8 to list of tested locales.
|
* tst-ctype.sh: Add de_DE.UTF-8 to list of tested locales.
|
||||||
|
|
|
||||||
|
|
@ -85,9 +85,7 @@ TST_MBRLEN tst_mbrlen_loc [] = {
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
{ 1, 0, 1, 0, },
|
{ 1, 0, 1, 0, },
|
||||||
/* <WAIVER_? x 2> assuming ascii */
|
|
||||||
{ 1, EILSEQ, 1, -1, },
|
{ 1, EILSEQ, 1, -1, },
|
||||||
/* <WAIVER_? x 2> assuming ascii */
|
|
||||||
{ 1, EILSEQ, 1, -1, },
|
{ 1, EILSEQ, 1, -1, },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -102,16 +100,20 @@ TST_MBRLEN tst_mbrlen_loc [] = {
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
{ 1, "\317\302", 1, 0, 0 },
|
{ 1, "\317\302", 1, 0, 0 },
|
||||||
|
#ifdef SHOJI_IS_RIGHT
|
||||||
{ 0, "", 0, 0, 0 },
|
{ 0, "", 0, 0, 0 },
|
||||||
|
#else
|
||||||
|
/* XXX This test depends on the internal state being empty.
|
||||||
|
XXX Therefore we must explicitly clean it. */
|
||||||
|
{ 0, "", 0, 0, 1 },
|
||||||
|
#endif
|
||||||
{ 1, "\317\302", USE_MBCURMAX, 0, 0 },
|
{ 1, "\317\302", USE_MBCURMAX, 0, 0 },
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
{ 1, 0, 1, -2, },
|
{ 1, 0, 1, -2, },
|
||||||
/* <WAIVER_?> returned -2 */
|
|
||||||
{ 1, 0, 1, 0, },
|
{ 1, 0, 1, 0, },
|
||||||
/* <WAIVER_?> returned 1 */
|
|
||||||
{ 1, 0, 1, 2, },
|
{ 1, 0, 1, 2, },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -127,8 +129,13 @@ TST_MBRLEN tst_mbrlen_loc [] = {
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
{ 1, 0, 1, -2, },
|
{ 1, 0, 1, -2, },
|
||||||
/* <WAIVER_?> returned -2 */
|
#ifdef SHOJI_IS_RIGHT
|
||||||
{ 1, 0, 1, +2, },
|
{ 1, 0, 1, +2, },
|
||||||
|
#else
|
||||||
|
/* XXX ISO C explicitly says that the return value does not
|
||||||
|
XXX reflect the bytes contained in the state. */
|
||||||
|
{ 1, 0, 1, +1, },
|
||||||
|
#endif
|
||||||
{ 1, 0, 1, 2, },
|
{ 1, 0, 1, 2, },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,12 +53,13 @@ tst_mbrlen (FILE * fp, int debug_flg)
|
||||||
}
|
}
|
||||||
|
|
||||||
ps = (t_flg == 0) ? NULL : &s;
|
ps = (t_flg == 0) ? NULL : &s;
|
||||||
#if 0
|
|
||||||
if (t_ini != 0)
|
if (t_ini != 0)
|
||||||
{
|
{
|
||||||
memset (&s, 0, sizeof (s));
|
memset (&s, 0, sizeof (s));
|
||||||
|
mbrlen (NULL, 0, NULL);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
TST_CLEAR_ERRNO;
|
TST_CLEAR_ERRNO;
|
||||||
ret = mbrlen (s_in, n, ps);
|
ret = mbrlen (s_in, n, ps);
|
||||||
TST_SAVE_ERRNO;
|
TST_SAVE_ERRNO;
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ static mbstate_t state;
|
||||||
size_t
|
size_t
|
||||||
__mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
|
__mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
|
||||||
{
|
{
|
||||||
mbstate_t temp_state;
|
|
||||||
wchar_t buf[1];
|
wchar_t buf[1];
|
||||||
struct __gconv_step_data data;
|
struct __gconv_step_data data;
|
||||||
int status;
|
int status;
|
||||||
|
|
@ -43,6 +42,7 @@ __mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
|
||||||
size_t dummy;
|
size_t dummy;
|
||||||
const unsigned char *inbuf;
|
const unsigned char *inbuf;
|
||||||
char *outbuf = (char *) (pwc ?: buf);
|
char *outbuf = (char *) (pwc ?: buf);
|
||||||
|
int flush;
|
||||||
|
|
||||||
/* Set information for this step. */
|
/* Set information for this step. */
|
||||||
data.__invocation_counter = 0;
|
data.__invocation_counter = 0;
|
||||||
|
|
@ -58,9 +58,10 @@ __mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
|
||||||
outbuf = (char *) buf;
|
outbuf = (char *) buf;
|
||||||
s = "";
|
s = "";
|
||||||
n = 1;
|
n = 1;
|
||||||
temp_state = *data.__statep;
|
flush = 1;
|
||||||
data.__statep = &temp_state;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
flush = *s == '\0' ? 1 : 0;
|
||||||
|
|
||||||
/* Tell where we want the result. */
|
/* Tell where we want the result. */
|
||||||
data.__outbuf = outbuf;
|
data.__outbuf = outbuf;
|
||||||
|
|
@ -73,7 +74,7 @@ __mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
|
||||||
inbuf = (const unsigned char *) s;
|
inbuf = (const unsigned char *) s;
|
||||||
status = DL_CALL_FCT (__wcsmbs_gconv_fcts.towc->__fct,
|
status = DL_CALL_FCT (__wcsmbs_gconv_fcts.towc->__fct,
|
||||||
(__wcsmbs_gconv_fcts.towc, &data, &inbuf, inbuf + n,
|
(__wcsmbs_gconv_fcts.towc, &data, &inbuf, inbuf + n,
|
||||||
NULL, &dummy, 0, 1));
|
NULL, &dummy, flush, 1));
|
||||||
|
|
||||||
/* There must not be any problems with the conversion but illegal input
|
/* There must not be any problems with the conversion but illegal input
|
||||||
characters. The output buffer must be large enough, otherwise the
|
characters. The output buffer must be large enough, otherwise the
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ static mbstate_t state;
|
||||||
size_t
|
size_t
|
||||||
__wcrtomb (char *s, wchar_t wc, mbstate_t *ps)
|
__wcrtomb (char *s, wchar_t wc, mbstate_t *ps)
|
||||||
{
|
{
|
||||||
mbstate_t temp_state;
|
|
||||||
char buf[MB_CUR_MAX];
|
char buf[MB_CUR_MAX];
|
||||||
struct __gconv_step_data data;
|
struct __gconv_step_data data;
|
||||||
int status;
|
int status;
|
||||||
|
|
@ -57,8 +56,6 @@ __wcrtomb (char *s, wchar_t wc, mbstate_t *ps)
|
||||||
{
|
{
|
||||||
s = buf;
|
s = buf;
|
||||||
wc = L'\0';
|
wc = L'\0';
|
||||||
temp_state = *data.__statep;
|
|
||||||
data.__statep = &temp_state;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tell where we want to have the result. */
|
/* Tell where we want to have the result. */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue