changeset 2787:3ff45da4e250

Addl fix #147: Darktable XMP Sidecar Files not grouped https://github.com/BestImageViewer/geeqie/issues/147 In some cases remove_level_from_path() returned NULL instead of a zero-length string. This caused problems when followed by a strcmp()
author Colin Clark <colin.clark@cclark.uk>
date Fri, 29 Jun 2018 11:27:49 +0100
parents 9113bf368caa
children 1d65d7ce3132
files src/ui_fileops.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ui_fileops.c	Thu Jun 28 19:22:21 2018 +0100
+++ b/src/ui_fileops.c	Fri Jun 29 11:27:49 2018 +0100
@@ -823,14 +823,14 @@
 {
 	const gchar *base;
 
-	if (!path) return NULL;
+	if (!path) return g_strdup("");
 
 	base = strrchr(path, G_DIR_SEPARATOR);
 	/* Take account of a file being in the root ( / ) folder - ensure the returned value
 	 * is at least one character long */
 	if (base) return g_strndup(path, (strlen(path)-strlen(base)) == 0 ? 1 : (strlen(path)-strlen(base)));
 
-	return NULL;
+	return g_strdup("");
 }
 
 gboolean file_extension_match(const gchar *path, const gchar *ext)