diff options
author | Daniel Lange <DLange@git.local> | 2023-02-05 04:25:56 +0100 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2023-02-05 04:25:56 +0100 |
commit | f288666edc9180a2e81e6655951878124f321df6 (patch) | |
tree | da70bf44b2423f6f8e9a070c063fed79d190b489 /pcp/PCPDynamicColumn.c | |
parent | 937052b231259a47d881d539ad5748245ef55b99 (diff) | |
download | debian_htop-f288666edc9180a2e81e6655951878124f321df6.tar.gz debian_htop-f288666edc9180a2e81e6655951878124f321df6.tar.bz2 debian_htop-f288666edc9180a2e81e6655951878124f321df6.zip |
New upstream version 3.2.2upstream/3.2.2
Diffstat (limited to 'pcp/PCPDynamicColumn.c')
-rw-r--r-- | pcp/PCPDynamicColumn.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pcp/PCPDynamicColumn.c b/pcp/PCPDynamicColumn.c index aab2525..33c6d72 100644 --- a/pcp/PCPDynamicColumn.c +++ b/pcp/PCPDynamicColumn.c @@ -14,6 +14,7 @@ in the source distribution for its full text. #include <ctype.h> #include <dirent.h> #include <errno.h> +#include <pwd.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> @@ -194,6 +195,12 @@ void PCPDynamicColumns_init(PCPDynamicColumns* columns) { const char* home = getenv("HOME"); char* path; + if (!xdgConfigHome && !home) { + const struct passwd* pw = getpwuid(getuid()); + if (pw) + home = pw->pw_dir; + } + columns->table = Hashtable_new(0, true); /* developer paths - PCP_HTOP_DIR=./pcp ./pcp-htop */ |