mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-01-30 11:45:08 +00:00
linux: use $HOME to determine actual user path
As it could be different in confined environments.
This commit is contained in:
parent
0de9c62675
commit
e88c575d4a
@ -293,6 +293,11 @@ void psActivateProcess(uint64 pid) {
|
||||
namespace {
|
||||
|
||||
QString getHomeDir() {
|
||||
auto home = QDir::homePath();
|
||||
|
||||
if (home != QDir::rootPath())
|
||||
return home + '/';
|
||||
|
||||
struct passwd *pw = getpwuid(getuid());
|
||||
return (pw && pw->pw_dir && strlen(pw->pw_dir)) ? (QFile::decodeName(pw->pw_dir) + '/') : QString();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user