diff --git a/plugins/editor/src/editor/NativeHelpers.cpp b/plugins/editor/src/editor/NativeHelpers.cpp index e4f0b320..0be3a57b 100644 --- a/plugins/editor/src/editor/NativeHelpers.cpp +++ b/plugins/editor/src/editor/NativeHelpers.cpp @@ -163,8 +163,9 @@ std::string getCurrentProcessName() #include #include #include +#include +#include #include -#include #include #include #include @@ -305,14 +306,22 @@ std::string getProcessorName() std::string name; std::string line; std::ifstream in("/proc/cpuinfo", std::ios::binary); - std::regex re("^model name\\s*:\\s*(.*)"); line.reserve(256); while (name.empty() && std::getline(in, line) && !line.empty()) { - std::smatch match; - if (std::regex_match(line, match, re)) - name = match[1]; + size_t pos = line.find(':'); + if (pos == line.npos) + continue; + + absl::string_view left = absl::string_view(line).substr(0, pos); + absl::string_view right = absl::string_view(line).substr(pos + 1); + + left = absl::StripAsciiWhitespace(left); + right = absl::StripAsciiWhitespace(right); + + if (left == "model name") + name = std::string(right); } if (name.empty())