summaryrefslogtreecommitdiffstats
path: root/Settings.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2012-03-05 11:12:58 +0000
committerHisham Muhammad <hisham@gobolinux.org>2012-03-05 11:12:58 +0000
commit368cb1fe20b66b91389f834019e2c2c18bdae8b7 (patch)
tree0da28f7873417a7f32457650fe7df440afde22b7 /Settings.c
parent571ae33bb4fa1afd1f06fbc2e1d3a0ab9b415b81 (diff)
avoid deleting valid symbolic links to .htoprc
so that home directories can be used with both old and new versions of htop (see #3496731).
Diffstat (limited to 'Settings.c')
-rw-r--r--Settings.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Settings.c b/Settings.c
index f2573e82..4782e84b 100644
--- a/Settings.c
+++ b/Settings.c
@@ -239,7 +239,9 @@ Settings* Settings_new(ProcessList* pl, Header* header, int cpuCount) {
mkdir(htopDir, 0700);
free(htopDir);
free(configDir);
- if (access(legacyDotfile, R_OK) != 0) {
+ struct stat st;
+ lstat(legacyDotfile, &st);
+ if (access(legacyDotfile, R_OK) != 0 || S_ISLNK(st.st_mode)) {
free(legacyDotfile);
legacyDotfile = NULL;
}

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