blob: 982d87b60f252d1c7584b6815d917892eb7b89c1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
Taken from upstream: http://htop.svn.sourceforge.net/viewvc/htop/trunk/Settings.c?view=patch&r1=286&r2=285&pathrev=286
Don't delete an old .htoprc if it's a symlink.
--- trunk/Settings.c 2012/02/17 13:45:58 285
+++ trunk/Settings.c 2012/03/05 11:12:58 286
@@ -239,7 +239,9 @@
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;
}
|