Mercurial > hg > forks > geeqie
changeset 2234:87ed572f1eea
Merge remote-tracking branch 'origin/merge-requests/5'
* origin/merge-requests/5:
Fix crash when loading collection listing inexistent files.
This is now a combination of Leons patch 900e65e and merge request of
Laurent. Hopefully that is now a bit more stable.
author | Klaus Ethgen <Klaus@Ethgen.de> |
---|---|
date | Sun, 20 Jul 2014 13:54:56 +0100 |
parents | 032e215fe904 (current diff) 083592055bcd (diff) |
children | d3a300d826d0 |
files | src/filedata.c |
diffstat | 2 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/collect.c Mon May 26 23:33:52 2014 +0100 +++ b/src/collect.c Sun Jul 20 13:54:56 2014 +0100 @@ -595,6 +595,10 @@ struct stat st; gboolean valid; + if (!fd) return FALSE; + + g_assert(fd->magick == FD_MAGICK); + if (must_exist) { valid = (stat_utf8(fd->path, &st) && !S_ISDIR(st.st_mode));
--- a/src/filedata.c Mon May 26 23:33:52 2014 +0100 +++ b/src/filedata.c Sun Jul 20 13:54:56 2014 +0100 @@ -1151,7 +1151,10 @@ fd = g_hash_table_lookup(file_data_pool, path_utf8); if (!fd) fd = file_data_new(path_utf8, &st, TRUE); - file_data_ref(fd); + if (fd) + { + file_data_ref(fd); + } filelist_free(files); g_free(dir);