changeset 605:651ae2be1031

Use g_ascii_strncasecmp() instead of strncasecmp() where applicable. Add a FIXME where potential improper usage of strncasecmp() is made.
author zas_
date Thu, 08 May 2008 12:50:25 +0000
parents 0b203af63dbf
children 408f36d536a5
files src/collect-dlg.c src/collect-io.c src/filefilter.c src/rcfile.c src/ui_fileops.c src/ui_pathsel.c
diffstat 6 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/collect-dlg.c	Thu May 08 12:38:34 2008 +0000
+++ b/src/collect-dlg.c	Thu May 08 12:50:25 2008 +0000
@@ -103,6 +103,7 @@
 
 	path = fd->dest_path;
 
+	/* FIXME: utf8 */
 	if (!(strlen(path) > 7 && strncasecmp(path + (strlen(path) - 4), ".gqv", 4) == 0))
 		{
 		gchar *buf;
--- a/src/collect-io.c	Thu May 08 12:38:34 2008 +0000
+++ b/src/collect-io.c	Thu May 08 12:50:25 2008 +0000
@@ -119,7 +119,7 @@
 		if (*p == '#')
 			{
 			if (!need_header) continue;
-			if (strncasecmp(p, GQ_COLLECTION_MARKER, strlen(GQ_COLLECTION_MARKER)) == 0)
+			if (g_ascii_strncasecmp(p, GQ_COLLECTION_MARKER, strlen(GQ_COLLECTION_MARKER)) == 0)
 				{
 				/* Looks like an official collection, allow unchecked input.
 				 * All this does is allow adding files that may not exist,
@@ -136,7 +136,7 @@
 				cd->window_read = TRUE;
 				if (only_geometry) break;
 				}
-			else if (strncasecmp(p, "#GQview collection", strlen("#GQview collection")) == 0)
+			else if (g_ascii_strncasecmp(p, "#GQview collection", strlen("#GQview collection")) == 0)
 				{
 				/* As 2008/04/15 there is no difference between our collection file format
 				 * and GQview 2.1.5 collection file format so ignore failures as well. */
--- a/src/filefilter.c	Thu May 08 12:38:34 2008 +0000
+++ b/src/filefilter.c	Thu May 08 12:50:25 2008 +0000
@@ -330,6 +330,7 @@
 
 		if (ln >= lf)
 			{
+			/* FIXME: utf8 */
 			if (strncasecmp(name + ln - lf, filter, lf) == 0) return TRUE;
 			}
 		work = work->next;
@@ -358,6 +359,7 @@
 
 		if (ln >= lf)
 			{
+			/* FIXME: utf8 */
 			if (strncasecmp(name + ln - lf, filter, lf) == 0) return TRUE;
 			}
 		work = work->next;
--- a/src/rcfile.c	Thu May 08 12:38:34 2008 +0000
+++ b/src/rcfile.c	Thu May 08 12:50:25 2008 +0000
@@ -776,7 +776,7 @@
 		READ_BOOL(color_profile.use_image);
 		READ_INT(color_profile.input_type);
 
-		if (strncasecmp(option, "color_profile.input_file_", 25) == 0)
+		if (g_ascii_strncasecmp(option, "color_profile.input_file_", 25) == 0)
 			{
 			i = strtol(option + 25, NULL, 0) - 1;
 			if (i >= 0 && i < COLOR_PROFILE_INPUTS)
@@ -784,7 +784,7 @@
 				read_char_option(f, option, option, value, &options->color_profile.input_file[i]);
 				}
 			}
-		if (strncasecmp(option, "color_profile.input_name_", 25) == 0)
+		if (g_ascii_strncasecmp(option, "color_profile.input_name_", 25) == 0)
 			{
 			i = strtol(option + 25, NULL, 0) - 1;
 			if (i >= 0 && i < COLOR_PROFILE_INPUTS)
@@ -798,7 +798,7 @@
 
 		/* External Programs */
 
-		if (strncasecmp(option, "external_", 9) == 0)
+		if (g_ascii_strncasecmp(option, "external_", 9) == 0)
 			{
 			i = strtol(option + 9, NULL, 0);
 			if (i > 0 && i <= GQ_EDITOR_SLOTS)
@@ -814,7 +814,7 @@
 			}
 
 		/* Exif */
-		if (0 == strncasecmp(option, "exif.display.", 13))
+		if (0 == g_ascii_strncasecmp(option, "exif.display.", 13))
 			{
 			for (i = 0; ExifUIList[i].key; i++)
 				if (0 == g_ascii_strcasecmp(option + 13, ExifUIList[i].key))
--- a/src/ui_fileops.c	Thu May 08 12:38:34 2008 +0000
+++ b/src/ui_fileops.c	Thu May 08 12:50:25 2008 +0000
@@ -645,6 +645,7 @@
 	p = strlen(path);
 	e = strlen(ext);
 
+	/* FIXME: utf8 */
 	return (p > e && strncasecmp(path + p - e, ext, e) == 0);
 }
 
--- a/src/ui_pathsel.c	Thu May 08 12:38:34 2008 +0000
+++ b/src/ui_pathsel.c	Thu May 08 12:50:25 2008 +0000
@@ -134,6 +134,7 @@
 			}
 		if (*f_ptr != '\0' && f_ptr[1] == ' ') f_ptr++;	/* skip space immediately after separator */
 		f_ptr++;
+		/* FIXME: utf8 */
 		if (l >= i && strncasecmp(file + l - i, strt_ptr, i) == 0) return TRUE;
 		}
 	return FALSE;