summaryrefslogtreecommitdiffstats
path: root/Settings.c
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2024-03-11 21:05:37 +0100
committerSefa Eyeoglu <contact@scrumplex.net>2024-03-11 23:15:24 +0100
commitf588b2731518e2a5b163d02cdeb3043c7d6fa92d (patch)
tree49f66f21e4b44ad4ea7326a3ec03265faa1acae4 /Settings.c
parent4feac8e72f76c7d50ac4e61689645796cd5fdc31 (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>
Diffstat (limited to 'Settings.c')
-rw-r--r--Settings.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Settings.c b/Settings.c
index 9f1170e7..c2d3e92f 100644
--- a/Settings.c
+++ b/Settings.c
@@ -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;

© 2014-2024 Faster IT GmbH | imprint | privacy policy