mirror of
https://https.git.savannah.gnu.org/git/gnulib.git
synced 2026-05-13 15:13:36 +00:00
Accommodate a difference between mbrtowc and mbrtoc32.
* lib/mbiter.h (mbiter_multi_next): Handle the mbrtoc32 return value (size_t)(-3). * lib/mbuiter.h (mbuiter_multi_next): Likewise. * lib/mbfile.h (mbfile_multi_getc): Likewise.
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
2023-06-30 Bruno Haible <bruno@clisp.org>
|
||||
|
||||
Accommodate a difference between mbrtowc and mbrtoc32.
|
||||
* lib/mbiter.h (mbiter_multi_next): Handle the mbrtoc32 return value
|
||||
(size_t)(-3).
|
||||
* lib/mbuiter.h (mbuiter_multi_next): Likewise.
|
||||
* lib/mbfile.h (mbfile_multi_getc): Likewise.
|
||||
|
||||
2023-06-30 Bruno Haible <bruno@clisp.org>
|
||||
|
||||
doc: Reference some reported bugs (in comments).
|
||||
|
||||
@@ -183,6 +183,10 @@ mbfile_multi_getc (struct mbchar *mbc, struct mbfile_multi *mbf)
|
||||
assert (mbf->buf[0] == '\0');
|
||||
assert (mbc->wc == 0);
|
||||
}
|
||||
else if (bytes == (size_t) -3)
|
||||
/* The previous multibyte sequence produced an additional 32-bit
|
||||
wide character. */
|
||||
bytes = 0;
|
||||
mbc->wc_valid = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -163,6 +163,10 @@ mbiter_multi_next (struct mbiter_multi *iter)
|
||||
assert (*iter->cur.ptr == '\0');
|
||||
assert (iter->cur.wc == 0);
|
||||
}
|
||||
else if (iter->cur.bytes == (size_t) -3)
|
||||
/* The previous multibyte sequence produced an additional 32-bit
|
||||
wide character. */
|
||||
iter->cur.bytes = 0;
|
||||
iter->cur.wc_valid = true;
|
||||
|
||||
/* When in the initial state, we can go back treating ASCII
|
||||
|
||||
@@ -172,6 +172,10 @@ mbuiter_multi_next (struct mbuiter_multi *iter)
|
||||
assert (*iter->cur.ptr == '\0');
|
||||
assert (iter->cur.wc == 0);
|
||||
}
|
||||
else if (iter->cur.bytes == (size_t) -3)
|
||||
/* The previous multibyte sequence produced an additional 32-bit
|
||||
wide character. */
|
||||
iter->cur.bytes = 0;
|
||||
iter->cur.wc_valid = true;
|
||||
|
||||
/* When in the initial state, we can go back treating ASCII
|
||||
|
||||
Reference in New Issue
Block a user