summaryrefslogtreecommitdiff
path: root/zen/sys_info.cpp
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2023-04-03 09:56:38 -0400
committerB. Stack <bgstack15@gmail.com>2023-04-03 09:56:38 -0400
commit765e1bb3bdeb5c49f08543c20206e55c772e6b80 (patch)
tree920f288910890016e540213fe65f2d6f38aa82be /zen/sys_info.cpp
parentadd upstream 12.1 (diff)
downloadFreeFileSync-765e1bb3bdeb5c49f08543c20206e55c772e6b80.tar.gz
FreeFileSync-765e1bb3bdeb5c49f08543c20206e55c772e6b80.tar.bz2
FreeFileSync-765e1bb3bdeb5c49f08543c20206e55c772e6b80.zip
add upstream 12.212.2
Diffstat (limited to 'zen/sys_info.cpp')
-rw-r--r--zen/sys_info.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/zen/sys_info.cpp b/zen/sys_info.cpp
index 55465711..2a32d247 100644
--- a/zen/sys_info.cpp
+++ b/zen/sys_info.cpp
@@ -131,8 +131,8 @@ ComputerModel zen::getComputerModel() //throw FileError
cm.model = beforeFirst(cm.model, L'\u00ff', IfNotFoundReturn::all); //fix broken BIOS entries:
cm.vendor = beforeFirst(cm.vendor, L'\u00ff', IfNotFoundReturn::all); //0xff can be considered 0
- trim(cm.model, false, true, [](wchar_t c) { return c == L'_'; }); //e.g. "CBX3___" or just "_"
- trim(cm.vendor, false, true, [](wchar_t c) { return c == L'_'; }); //e.g. "DELL__" or just "_"
+ trim(cm.model, TrimSide::right, [](wchar_t c) { return c == L'_'; }); //e.g. "CBX3___" or just "_"
+ trim(cm.vendor, TrimSide::right, [](wchar_t c) { return c == L'_'; }); //e.g. "DELL__" or just "_"
for (const char* dummyModel :
{
@@ -209,9 +209,13 @@ std::wstring zen::getOsDescription() //throw FileError
Zstring zen::getRealProcessPath() //throw FileError
{
- return getSymlinkRawContent("/proc/self/exe").targetPath; //throw FileError
- //path does not contain symlinks => no need for ::realpath()
+ try
+ {
+ return getSymlinkRawContent_impl("/proc/self/exe").targetPath; //throw SysError
+ //path does not contain symlinks => no need for ::realpath()
+ }
+ catch (const SysError& e) { throw FileError(_("Cannot get process information."), e.toString()); }
}
bgstack15