summaryrefslogtreecommitdiff
path: root/zen/sys_version.cpp
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2022-11-22 08:54:34 -0500
committerB. Stack <bgstack15@gmail.com>2022-11-22 08:54:34 -0500
commita034cfca98d4408b175938740628a54f57eb7614 (patch)
tree501fd78c6276c0be8be8d2c671a58dd0598060b5 /zen/sys_version.cpp
parentadd upstream 11.27 (diff)
downloadFreeFileSync-a034cfca98d4408b175938740628a54f57eb7614.tar.gz
FreeFileSync-a034cfca98d4408b175938740628a54f57eb7614.tar.bz2
FreeFileSync-a034cfca98d4408b175938740628a54f57eb7614.zip
add upstream 11.2811.28
Diffstat (limited to 'zen/sys_version.cpp')
-rw-r--r--zen/sys_version.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/zen/sys_version.cpp b/zen/sys_version.cpp
index d187e0f0..b123ba07 100644
--- a/zen/sys_version.cpp
+++ b/zen/sys_version.cpp
@@ -47,13 +47,14 @@ OsVersionDetail zen::getOsVersionDetail() //throw SysError
}
catch (const FileError& e) { throw SysError(replaceCpy(e.toString(), L"\n\n", L'\n')); } //errors should be further enriched by context info => SysError
- for (const std::string& line : split(releaseInfo, '\n', SplitOnEmpty::skip))
+ split(releaseInfo, '\n', [&](const std::string_view line)
+ {
if (startsWith(line, "NAME="))
osName = utfTo<std::wstring>(afterFirst(line, '=', IfNotFoundReturn::none));
else if (startsWith(line, "VERSION_ID="))
osVersion = utfTo<std::wstring>(afterFirst(line, '=', IfNotFoundReturn::none));
- //PRETTY_NAME? too wordy! e.g. "Fedora 17 (Beefy Miracle)"
-
+ //PRETTY_NAME? too wordy! e.g. "Fedora 17 (Beefy Miracle)"
+ });
trim(osName, true, true, [](char c) { return c == L'"' || c == L'\''; });
trim(osVersion, true, true, [](char c) { return c == L'"' || c == L'\''; });
}
@@ -64,7 +65,7 @@ OsVersionDetail zen::getOsVersionDetail() //throw SysError
// lsb_release Release is "rolling"
// etc/os-release: VERSION_ID is missing
- std::vector<std::wstring> verDigits = split<std::wstring>(osVersion, L'.', SplitOnEmpty::allow); //e.g. "7.7.1908"
+ std::vector<std::wstring_view> verDigits = splitCpy<std::wstring_view>(osVersion, L'.', SplitOnEmpty::allow); //e.g. "7.7.1908"
verDigits.resize(2);
return OsVersionDetail
bgstack15