Files
sed/testsuite
Paul Eggert 2b155a6c8b sed: support multibyte delimiters
* basicdefs.h: Do not include wchar.h, wctype.h.
(ISASCII, ISBLANK, ISSPACE): Remove.  All uses replaced
by c32isblank, c32isspace.
* bootstrap.conf (gnulib_modules): Add c32isblank, c32isprint,
c32isspace, c32rtomb, c32toower, c32toupper, mcel.  Remove btowc,
localcharset, mbrlen, mbrtowc, mbsinit, wcrtomb, wctob, wctype-h.
* configure.ac: Do not check for headers locale.h, errno.h,
wchar.h, wctype.h, mcheck.h.
Do not check for isascii.  Remove ac_cv_func_wcscoll hack.
(XFAIL_TESTS): Remove check for whether to run UTF-8 Cyrillic
tests, as I hope the other changes in this patch should fix
problems in that area.
* lib/.gitignore, m4/.gitignore: Adjust
* sed/compile.c (struct prog_info.prev): New member.
Adjust all users of this struct to update and use it when needed.
(INCHAR_EOF): New constant.
(inchar): Return a char32_t value for each wide character, a
negative byte value for encoding errors, and INCHAR_EOF for end of
input.  All callers changed.
(savchar): Now takes no arguments.  All callers changed.
(in_nonblank): Use char32_t tests rather than ctype.h tests.
(add_prev_to_buffer): New function.
(add_then_next, match_slash, read_text):
Use add_prev_to_buffer instead of add1_buffer when the idea is to
copy a character from input to output, as the character might be
multibyte and add1_buffer does only single-byte.
(match_slash): Support multibyte delimiters.  Test for matchers
individually rather than via strchr, to make it clearer that we
are not testing for '\0'.
* sed/compile.c (add_then_next, snarf_char_class):
* sed/debug.c (debug_print_mb):
* sed/execute.c (line_init, line_reset, line_copy, line_append)
(line_exchange):
Remove now-unnecessary arg.  All callers changed.
* sed/compile.c (compile_program, normalize_text):
* sed/debug.c (debug_print_regex_pattern):
* sed/execute.c (str_append_modified, do_list, translate_mb)
(debug_print_line):
Use mcel_scan/c32rtomb1 not mbrtowc1/mbrlen1/wcrtomb,
as mcel_scan should work better on MS-Windows.
* sed/debug.c (debug_print_char): Replace args c and clen
with an mcel_t arg g.  All callers changed.
(debug_print_mb): Adjust to new meaning of int “characters”.
* sed/execute.c (struct line.mbstate): Remove.  All uses removed.
(str_append): Omit no-longer-needed code put in just to update a
no-longer-needed mbstate_t.
(str_append_modified): Don’t worry about c32rtomb1 returning
(size_t) -1, as it now returns idx_t and anyway that cannot happen.
* sed/mbcs.c: Don’t include string.h, localcharset.h.
(is_mb_char, is_utf8): Remove.  All uses removed.
* sed/sed.h: Include mcel.h.
(mbrtowc1, mbrlen1): Remove.  All callers changed to use mcel_scan.
(c32rtomb1): New function.
(IS_MB_CHAR): Remove; no longer used.
* sed/utils.c (add1_buffer): Now returns void, since no caller
used the return value.  2nd arg is now char, not int.
Remove special case for EOF.  All callers changed.
* testsuite/mb-bad-delim.sh, testsuite/mb-y-translate.sh:
Multibyte delimiters are no longer prohibited, so adjust test
cases accordingly.  Put newlines at end of text files,
as required by POSIX.
2026-08-17 01:17:23 -07:00
..
2004-10-20 21:42:31 +00:00
2004-10-20 21:42:31 +00:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2004-10-20 21:42:31 +00:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2004-10-20 21:42:31 +00:00
2004-10-20 21:42:31 +00:00
2004-10-20 21:42:31 +00:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2020-01-09 22:56:39 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2004-10-20 21:42:31 +00:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2018-12-20 21:23:11 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00
2026-01-02 17:33:20 -08:00