mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 09:39:52 +08:00
re: Use the variable-width pcre2 type
This was what we always did in string. It makes it match the annoyingly variable width of wchar_t. Fixes #9502
This commit is contained in:
parent
9b4c4ee7b6
commit
52d2087dd3
|
@ -251,7 +251,8 @@ maybe_t<wcstring> regex_t::substitute(const wcstring &subject, const wcstring &r
|
||||||
error_code_t rc =
|
error_code_t rc =
|
||||||
pcre2_substitute(get_code(code_), to_sptr(subject), subject.size(), start_idx, options,
|
pcre2_substitute(get_code(code_), to_sptr(subject), subject.size(), start_idx, options,
|
||||||
nullptr /* match_data */, nullptr /* context */, to_sptr(replacement),
|
nullptr /* match_data */, nullptr /* context */, to_sptr(replacement),
|
||||||
replacement.size(), reinterpret_cast<PCRE2_UCHAR32 *>(buffer), &bufflen);
|
// (not using UCHAR32 here for cygwin's benefit)
|
||||||
|
replacement.size(), reinterpret_cast<PCRE2_UCHAR *>(buffer), &bufflen);
|
||||||
|
|
||||||
if (out_repl_count) {
|
if (out_repl_count) {
|
||||||
*out_repl_count = std::max(rc, 0);
|
*out_repl_count = std::max(rc, 0);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user