diff --git a/src/re.cpp b/src/re.cpp index 9dba0e18d..120473325 100644 --- a/src/re.cpp +++ b/src/re.cpp @@ -251,7 +251,8 @@ maybe_t regex_t::substitute(const wcstring &subject, const wcstring &r error_code_t rc = pcre2_substitute(get_code(code_), to_sptr(subject), subject.size(), start_idx, options, nullptr /* match_data */, nullptr /* context */, to_sptr(replacement), - replacement.size(), reinterpret_cast(buffer), &bufflen); + // (not using UCHAR32 here for cygwin's benefit) + replacement.size(), reinterpret_cast(buffer), &bufflen); if (out_repl_count) { *out_repl_count = std::max(rc, 0);