mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
parent
3d74b160b3
commit
8d6735cb41
3 changed files with 9 additions and 2 deletions
|
@ -376,8 +376,12 @@ class pcre2_matcher_t : public string_matcher_t {
|
||||||
// Return values: -1 = error, 0 = no match, 1 = match.
|
// Return values: -1 = error, 0 = no match, 1 = match.
|
||||||
if (pcre2_rc == PCRE2_ERROR_NOMATCH) {
|
if (pcre2_rc == PCRE2_ERROR_NOMATCH) {
|
||||||
if (opts.invert_match && !opts.quiet) {
|
if (opts.invert_match && !opts.quiet) {
|
||||||
streams.out.append(arg);
|
if (opts.index) {
|
||||||
streams.out.push_back(L'\n');
|
streams.out.append_format(L"1 %lu\n", wcslen(arg));
|
||||||
|
} else {
|
||||||
|
streams.out.append(arg);
|
||||||
|
streams.out.push_back(L'\n');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return opts.invert_match ? 1 : 0;
|
return opts.invert_match ? 1 : 0;
|
||||||
|
|
|
@ -88,3 +88,5 @@ string length 2>/dev/null; or echo "missing argument returns 0"
|
||||||
string match -r -v "[dcantg].*" dog can cat diz; or echo "no regexp invert match"
|
string match -r -v "[dcantg].*" dog can cat diz; or echo "no regexp invert match"
|
||||||
|
|
||||||
string match -v "???" dog can cat diz; or echo "no glob invert match"
|
string match -v "???" dog can cat diz; or echo "no glob invert match"
|
||||||
|
|
||||||
|
string match -rvn a bbb
|
||||||
|
|
|
@ -62,3 +62,4 @@ invalid argument error
|
||||||
missing argument returns 0
|
missing argument returns 0
|
||||||
no regexp invert match
|
no regexp invert match
|
||||||
no glob invert match
|
no glob invert match
|
||||||
|
1 3
|
||||||
|
|
Loading…
Reference in a new issue