mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 04:39:39 +08:00
Remove usage of PCRE2_SUBSTITUTE_LITERAL
We don't need this flag and this ties us to a newer version of PCRE2 than we would like. Fixes #9061.
This commit is contained in:
parent
cbd0ec568c
commit
a9964cd6d0
@ -6817,12 +6817,6 @@ static void test_re_substitute() {
|
||||
do_test(res && *res == L"AA123qqqZZ AA123qqqZZ");
|
||||
do_test(repl_count == 2);
|
||||
|
||||
sflags.literal = true;
|
||||
res = re->substitute(subj, repl, sflags, 0, nullptr, &repl_count);
|
||||
do_test(res && *res == L"AA$1qqqZZ AA$1qqqZZ");
|
||||
do_test(repl_count == 2);
|
||||
|
||||
sflags.literal = false;
|
||||
sflags.extended = true;
|
||||
res = re->substitute(subj, L"\\x21", sflags, 0, nullptr, &repl_count); // \x21 = !
|
||||
do_test(res && *res == L"AA!ZZ AA!ZZ");
|
||||
|
@ -237,7 +237,6 @@ maybe_t<wcstring> regex_t::substitute(const wcstring &subject, const wcstring &r
|
||||
uint32_t options = PCRE2_SUBSTITUTE_UNSET_EMPTY // don't error on unmatched
|
||||
| PCRE2_SUBSTITUTE_OVERFLOW_LENGTH // return required length on overflow
|
||||
| (flags.global ? PCRE2_SUBSTITUTE_GLOBAL : 0) // replace multiple
|
||||
| (flags.literal ? PCRE2_SUBSTITUTE_LITERAL : 0) // respect $1, etc.
|
||||
| (flags.extended ? PCRE2_SUBSTITUTE_EXTENDED : 0) // backslash escapes
|
||||
;
|
||||
size_t bufflen = stack_bufflen;
|
||||
|
Loading…
x
Reference in New Issue
Block a user