Skip to content

Commit 03bf5c5

Browse files
nodejs-github-bottargos
authored andcommitted
deps: update googletest to 2dd1c13
PR-URL: #50081 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
1 parent edb0ffd commit 03bf5c5

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.19.0][]
1616
* [cjs-module-lexer 1.2.2][]
1717
* [corepack][]
18-
* [googletest e47544a][]
18+
* [googletest 2dd1c13][]
1919
* [histogram 0.11.8][]
2020
* [icu-small 73.2][]
2121
* [libuv 1.46.0][]
@@ -189,7 +189,7 @@ In practical terms, Corepack will let you use Yarn and pnpm without having to
189189
install them - just like what currently happens with npm, which is shipped
190190
by Node.js by default.
191191

192-
### googletest e47544a
192+
### googletest 2dd1c13
193193

194194
The [googletest](https://github.com/google/googletest) dependency is Google’s
195195
C++ testing and mocking framework.
@@ -326,7 +326,7 @@ performance improvements not currently available in standard zlib.
326326
[cjs-module-lexer 1.2.2]: #cjs-module-lexer-122
327327
[corepack]: #corepack
328328
[dependency-update-action]: ../../../.github/workflows/tools.yml
329-
[googletest e47544a]: #googletest-e47544a
329+
[googletest 2dd1c13]: #googletest-2dd1c13
330330
[histogram 0.11.8]: #histogram-0118
331331
[icu-small 73.2]: #icu-small-732
332332
[libuv 1.46.0]: #libuv-1460

0 commit comments

Comments
 (0)