Mercurial > geeqie
comparison src/ui_fileops.c @ 998:d2701a5864c5
Fixed segfault when is run inside directory with non valid uft-8 image
filename.
author | bruclik |
---|---|
date | Tue, 26 Aug 2008 20:21:30 +0000 |
parents | 070bfc3591bc |
children | 4fe8f9656107 |
comparison
equal
deleted
inserted
replaced
997:c74c4e87a682 | 998:d2701a5864c5 |
---|---|
170 } | 170 } |
171 | 171 |
172 return path; | 172 return path; |
173 } | 173 } |
174 | 174 |
175 /* first we try the HOME environment var, if that doesn't work, we try getpwuid(). */ | 175 /* first we try the HOME environment var, if that doesn't work, we try g_get_homedir(). */ |
176 const gchar *homedir(void) | 176 const gchar *homedir(void) |
177 { | 177 { |
178 static gchar *home = NULL; | 178 static gchar *home = NULL; |
179 | 179 |
180 if (!home) | 180 if (!home) |
181 { | |
182 home = path_to_utf8(getenv("HOME")); | 181 home = path_to_utf8(getenv("HOME")); |
183 } | 182 |
184 if (!home) | 183 if (!home) |
185 { | 184 home = path_to_utf8(g_get_home_dir()); |
186 struct passwd *pw = getpwuid(getuid()); | |
187 if (pw) home = path_to_utf8(pw->pw_dir); | |
188 } | |
189 | 185 |
190 return home; | 186 return home; |
191 } | 187 } |
192 | 188 |
193 gint stat_utf8(const gchar *s, struct stat *st) | 189 gint stat_utf8(const gchar *s, struct stat *st) |