Skip to content

Commit c4b6d0e

Browse files
committed
Windows inserts a \r character, it seems
1 parent be7d423 commit c4b6d0e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/_TestingInternals/Versions.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ const char *swt_getTestingLibraryVersion(void) {
3131
// Copy the first line from the C string into a C array so that we can
3232
// return it from this closure.
3333
std::array<char, std::size(version) + 1> result {};
34-
auto i = std::find(std::begin(version), std::end(version), '\n');
34+
auto i = std::find_if(std::begin(version), std::end(version), [] (char c) {
35+
return c == '\r' || c == '\n';
36+
});
3537
std::copy(std::begin(version), i, result.begin());
3638
return result;
3739
}();

0 commit comments

Comments
 (0)