]> Savannah Git Hosting - gnulib.git/commit
unistr/uN-strtok: handle multibyte delimiters
authorSeiya Kawashima <skawashima@uchicago.edu>
Fri, 3 Jul 2015 02:42:43 +0000 (11:42 +0900)
committerDaiki Ueno <ueno@gnu.org>
Fri, 3 Jul 2015 02:48:29 +0000 (11:48 +0900)
commit2c5543396b7c208b34fa714430801945aefb1fe8
tree29e07e39beaa65e470c567cc9a38aaa93e176ad9
parent841d0dcfa8103235836a1aeb0c1ad657f43ade85
unistr/uN-strtok: handle multibyte delimiters

Previously, uN_strtok moved PTR to the next unit to the token end.
When DELIM contained a multibyte character, the new position could
be a middle of a multibyte character.
* lib/unistr/u-strtok.h (FUNC): Place PTR at the next character
after the token.
* lib/unistr/u8-strtok.c (U_STRMBLEN): New macro.
* lib/unistr/u16-strtok.c (U_STRMBLEN): New macro.
* lib/unistr/u32-strtok.c (U_STRMBLEN): New macro.
* modules/unistr/u8-strtok (Depends-on): Depend on
unistr/u8-strmblen.
* modules/unistr/u16-strtok (Depends-on): Depend on
unistr/u16-strmblen.
* modules/unistr/u32-strtok (Depends-on): Depend on
unistr/u32-strmblen.
* tests/unistr/test-u-strtok.h: New file.
* tests/unistr/test-u8-strtok.c: New file.
* tests/unistr/test-u16-strtok.c: New file.
* tests/unistr/test-u32-strtok.c: New file.
* modules/unistr/u8-strtok-tests: New file.
* modules/unistr/u32-strtok-tests: New file.
* modules/unistr/u16-strtok-tests: New file.
Copyright-paperwork-exempt: yes
Co-authored-by: Daiki Ueno <ueno@gnu.org>
15 files changed:
ChangeLog
lib/unistr/u-strtok.h
lib/unistr/u16-strtok.c
lib/unistr/u32-strtok.c
lib/unistr/u8-strtok.c
modules/unistr/u16-strtok
modules/unistr/u16-strtok-tests [new file with mode: 0644]
modules/unistr/u32-strtok
modules/unistr/u32-strtok-tests [new file with mode: 0644]
modules/unistr/u8-strtok
modules/unistr/u8-strtok-tests [new file with mode: 0644]
tests/unistr/test-u-strtok.h [new file with mode: 0644]
tests/unistr/test-u16-strtok.c [new file with mode: 0644]
tests/unistr/test-u32-strtok.c [new file with mode: 0644]
tests/unistr/test-u8-strtok.c [new file with mode: 0644]