summaryrefslogtreecommitdiff
path: root/zen/sys_info.cpp
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2023-01-22 13:56:55 -0500
committerB. Stack <bgstack15@gmail.com>2023-01-22 13:56:55 -0500
commit75e05bc441382db69c842a64c562738cb749214e (patch)
tree698b60b3b4b914bf7958cf1174d0373909bf1e8f /zen/sys_info.cpp
parentadd upstream 11.29 (diff)
downloadFreeFileSync-75e05bc441382db69c842a64c562738cb749214e.tar.gz
FreeFileSync-75e05bc441382db69c842a64c562738cb749214e.tar.bz2
FreeFileSync-75e05bc441382db69c842a64c562738cb749214e.zip
add upstream 12.0
Diffstat (limited to 'zen/sys_info.cpp')
-rw-r--r--zen/sys_info.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/zen/sys_info.cpp b/zen/sys_info.cpp
index df0e4612..244343f2 100644
--- a/zen/sys_info.cpp
+++ b/zen/sys_info.cpp
@@ -48,7 +48,7 @@ Zstring zen::getLoginUser() //throw FileError
&pwEntry); //struct passwd** result
rv != 0 || !pwEntry)
{
- //"If an error occurs, errno is set appropriately" => why the fuck, then also return errno as return value!?
+ //"If an error occurs, errno is set appropriately" => why the fuck, then, also return errno as return value!?
errno = rv != 0 ? rv : ENOENT;
THROW_LAST_FILE_ERROR(_("Cannot get process information."), "getpwuid_r(" + numberTo<std::string>(userIdNo) + ')');
}
@@ -65,9 +65,9 @@ Zstring zen::getLoginUser() //throw FileError
//BUT: getlogin() can fail with ENOENT on Linux Mint: https://freefilesync.org/forum/viewtopic.php?t=8181
//getting a little desperate: variables used by installer.sh
- if (const char* userName = tryGetNonRootUser("USER")) return userName;
- if (const char* userName = tryGetNonRootUser("SUDO_USER")) return userName;
- if (const char* userName = tryGetNonRootUser("LOGNAME")) return userName;
+ if (const char* username = tryGetNonRootUser("USER")) return username;
+ if (const char* username = tryGetNonRootUser("SUDO_USER")) return username;
+ if (const char* username = tryGetNonRootUser("LOGNAME")) return username;
//apparently the current user really IS root: https://freefilesync.org/forum/viewtopic.php?t=8405
@@ -78,7 +78,7 @@ Zstring zen::getLoginUser() //throw FileError
Zstring zen::getUserDescription() //throw FileError
{
- const Zstring userName = getLoginUser(); //throw FileError
+ const Zstring username = getLoginUser(); //throw FileError
const Zstring computerName = []() -> Zstring //throw FileError
{
std::vector<char> buf(10000);
@@ -92,10 +92,10 @@ Zstring zen::getUserDescription() //throw FileError
return hostName;
}();
- if (contains(getUpperCase(computerName), getUpperCase(userName)))
- return userName; //no need for text duplication! e.g. "Zenju (Zenju-PC)"
+ if (contains(getUpperCase(computerName), getUpperCase(username)))
+ return username; //no need for text duplication! e.g. "Zenju (Zenju-PC)"
- return userName + Zstr(" (") + computerName + Zstr(')'); //e.g. "Admin (Zenju-PC)"
+ return username + Zstr(" (") + computerName + Zstr(')'); //e.g. "Admin (Zenju-PC)"
}
@@ -118,7 +118,7 @@ ComputerModel zen::getComputerModel() //throw FileError
}
catch (FileError&)
{
- if (!itemStillExists(filePath)) //throw FileError
+ if (!itemExists(filePath)) //throw FileError
return std::wstring();
throw;
bgstack15