Skip to content

Commit e0fd52b

Browse files
nodejs-github-bottargos
authored andcommitted
deps: update googletest to 2dd1c13
PR-URL: #50081 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
1 parent 1b103cc commit e0fd52b

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

deps/googletest/src/gtest-port.cc

+13-2
Original file line numberDiff line numberDiff line change
@@ -697,13 +697,24 @@ bool RE::PartialMatch(const char* str, const RE& re) {
697697
void RE::Init(const char* regex) {
698698
pattern_ = regex;
699699

700+
// NetBSD (and Android, which takes its regex implemntation from NetBSD) does
701+
// not include the GNU regex extensions (such as Perl style character classes
702+
// like \w) in REG_EXTENDED. REG_EXTENDED is only specified to include the
703+
// [[:alpha:]] style character classes. Enable REG_GNU wherever it is defined
704+
// so users can use those extensions.
705+
#if defined(REG_GNU)
706+
constexpr int reg_flags = REG_EXTENDED | REG_GNU;
707+
#else
708+
constexpr int reg_flags = REG_EXTENDED;
709+
#endif
710+
700711
// Reserves enough bytes to hold the regular expression used for a
701712
// full match.
702713
const size_t full_regex_len = strlen(regex) + 10;
703714
char* const full_pattern = new char[full_regex_len];
704715

705716
snprintf(full_pattern, full_regex_len, "^(%s)$", regex);
706-
is_valid_ = regcomp(&full_regex_, full_pattern, REG_EXTENDED) == 0;
717+
is_valid_ = regcomp(&full_regex_, full_pattern, reg_flags) == 0;
707718
// We want to call regcomp(&partial_regex_, ...) even if the
708719
// previous expression returns false. Otherwise partial_regex_ may
709720
// not be properly initialized can may cause trouble when it's
@@ -714,7 +725,7 @@ void RE::Init(const char* regex) {
714725
// regex. We change it to an equivalent form "()" to be safe.
715726
if (is_valid_) {
716727
const char* const partial_regex = (*regex == '\0') ? "()" : regex;
717-
is_valid_ = regcomp(&partial_regex_, partial_regex, REG_EXTENDED) == 0;
728+
is_valid_ = regcomp(&partial_regex_, partial_regex, reg_flags) == 0;
718729
}
719730
EXPECT_TRUE(is_valid_)
720731
<< "Regular expression \"" << regex

doc/contributing/maintaining/maintaining-dependencies.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This a list of all the dependencies:
1515
* [c-ares 1.20.1][]
1616
* [cjs-module-lexer][]
1717
* [corepack][]
18-
* [googletest e47544a][]
18+
* [googletest 2dd1c13][]
1919
* [histogram][]
2020
* [icu-small][]
2121
* [llhttp][]
@@ -187,7 +187,7 @@ In practical terms, Corepack will let you use Yarn and pnpm without having to
187187
install them - just like what currently happens with npm, which is shipped
188188
by Node.js by default.
189189

190-
### googletest e47544a
190+
### googletest 2dd1c13
191191

192192
The [googletest](https://github.com/google/googletest) dependency is Google’s
193193
C++ testing and mocking framework.
@@ -319,7 +319,7 @@ performance improvements not currently available in standard zlib.
319319
[cjs-module-lexer]: #cjs-module-lexer
320320
[corepack]: #corepack
321321
[dependency-update-action]: ../../../.github/workflows/tools.yml
322-
[googletest e47544a]: #googletest-e47544a
322+
[googletest 2dd1c13]: #googletest-2dd1c13
323323
[histogram]: #histogram
324324
[icu-small]: #icu-small
325325
[llhttp]: #llhttp

0 commit comments

Comments
 (0)