commit | author | age
|
bae226
|
1 |
Workaround for: |
MN |
2 |
|
|
3 |
https://bugzilla.mozilla.org/show_bug.cgi?id=1450912 |
|
4 |
|
|
5 |
Should be more investigated and reopen bug. |
a4af93
|
6 |
|
CG |
7 |
diff -r c56ef1c14a55 gfx/gl/GLContext.cpp |
|
8 |
--- a/gfx/gl/GLContext.cpp Wed Mar 14 00:40:07 2018 +0200 |
|
9 |
+++ b/gfx/gl/GLContext.cpp Wed Apr 04 14:51:13 2018 +0000 |
bae226
|
10 |
@@ -204,12 +204,11 @@ |
MN |
11 |
|
|
12 |
static bool ParseVersion(const std::string& versionStr, |
|
13 |
uint32_t* const out_major, uint32_t* const out_minor) { |
|
14 |
- static const std::regex kVersionRegex("([0-9]+)\\.([0-9]+)"); |
|
15 |
- std::smatch match; |
|
16 |
- if (!std::regex_search(versionStr, match, kVersionRegex)) return false; |
|
17 |
- |
|
18 |
- const auto& majorStr = match.str(1); |
|
19 |
- const auto& minorStr = match.str(2); |
a4af93
|
20 |
+ size_t dot_index = versionStr.find('.', 0); |
CG |
21 |
+ if (dot_index == -1) |
|
22 |
+ return false; |
|
23 |
+ const auto& majorStr = versionStr.substr(0, dot_index); |
|
24 |
+ const auto& minorStr = versionStr.substr(dot_index+1, 2); |
bae226
|
25 |
*out_major = atoi(majorStr.c_str()); |
MN |
26 |
*out_minor = atoi(minorStr.c_str()); |
|
27 |
return true; |