diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2024-03-11 21:05:37 +0100 |
---|---|---|
committer | Sefa Eyeoglu <contact@scrumplex.net> | 2024-03-11 23:15:24 +0100 |
commit | f588b2731518e2a5b163d02cdeb3043c7d6fa92d (patch) | |
tree | 49f66f21e4b44ad4ea7326a3ec03265faa1acae4 | |
parent | 4feac8e72f76c7d50ac4e61689645796cd5fdc31 (diff) |
Resolve configuration path
Some configuration systems might link a htop configuration file and we
don't really want to replace the symlink but rather its source. This
will also allow us to fail in case the source is read only.
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
-rw-r--r-- | Settings.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -826,6 +826,12 @@ Settings* Settings_new(unsigned int initialCpuCount, Hashtable* dynamicMeters, H legacyDotfile = NULL; } } + + char* resolvedFilename = xMalloc(PATH_MAX); + if (realpath(this->filename, resolvedFilename)) + free_and_xStrdup(&this->filename, resolvedFilename); + free(resolvedFilename); + this->colorScheme = 0; #ifdef HAVE_GETMOUSE this->enableMouse = true; |