Commit 368cb1fe authored by Hisham Muhammad's avatar Hisham Muhammad
Browse files

avoid deleting valid symbolic links to .htoprc

so that home directories can be used with both old and new versions of htop
(see #3496731).
parent 571ae33b
...@@ -239,7 +239,9 @@ Settings* Settings_new(ProcessList* pl, Header* header, int cpuCount) { ...@@ -239,7 +239,9 @@ Settings* Settings_new(ProcessList* pl, Header* header, int cpuCount) {
mkdir(htopDir, 0700); mkdir(htopDir, 0700);
free(htopDir); free(htopDir);
free(configDir); 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); free(legacyDotfile);
legacyDotfile = NULL; legacyDotfile = NULL;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment