diff src/ui_fileops.c @ 1701:f80ee95314dd

fixed sidecar grouping this fixes grouping of files which differs only in upper/lowercase extension. The old code stopped scanning when the first file was found.
author nadvornik
date Sat, 22 Aug 2009 20:20:19 +0000
parents ceafe3731568
children b8d37cc79410
line wrap: on
line diff
--- a/src/ui_fileops.c	Tue Jun 30 23:40:37 2009 +0000
+++ b/src/ui_fileops.c	Sat Aug 22 20:20:19 2009 +0000
@@ -328,51 +328,6 @@
 	return ret;
 }
 
-/* extension must contain only ASCII characters */
-gboolean stat_utf8_case_insensitive_ext(GString *base, const gchar *ext, struct stat *st)
-{
-	gchar *sl;
-	gchar *extl;
-	gboolean ret = FALSE;
-	gint ext_len;
-	gint base_len = strlen(base->str);
-
-	g_string_append(base, ext);
-	sl = path_from_utf8(base->str);
-	
-	extl = strrchr(sl, '.');
-	if (extl)
-		{
-		gint i, j;
-		extl++; /* the first char after . */
-		ext_len = strlen(extl);
-	
-		for (i = 0; i < (1 << ext_len); i++)
-			{
-			for (j = 0; j < ext_len; j++)
-				{
-				if (i & (1 << j)) 
-					extl[j] = g_ascii_toupper(extl[j]);
-				else
-					extl[j] = g_ascii_tolower(extl[j]);
-				}
-			ret = (stat(sl, st) == 0);
-			if (ret) break;
-			}
-		
-		if (ret)
-			{
-			/* append the found extension to base */
-			base = g_string_truncate(base, base_len);
-			extl--;
-			g_string_append(base, extl);
-			}
-		}
-	g_free(sl);
-
-	return ret;
-}
-
 gboolean isname(const gchar *s)
 {
 	struct stat st;