[easytag/wip/libsoup-cddb: 3/5] Replace a further use of strcasecmp()



commit b46960f672d8b2c451b3bd48ac4c39723ea0b5cf
Author: David King <amigadave amigadave com>
Date:   Thu Mar 10 21:00:14 2016 +0000

    Replace a further use of strcasecmp()
    
    Ignore the locale when comparing CDDB genres.

 src/cddb_dialog.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/cddb_dialog.c b/src/cddb_dialog.c
index 31bca7b..1bbe009 100644
--- a/src/cddb_dialog.c
+++ b/src/cddb_dialog.c
@@ -2994,13 +2994,18 @@ et_cddb_dialog_search_from_selection (EtCDDBDialog *self)
 static const gchar *
 Cddb_Get_Id3_Genre_From_Cddb_Genre (const gchar *cddb_genre)
 {
-    guint i;
+    gsize i;
 
     g_return_val_if_fail (cddb_genre != NULL, "");
 
-    for (i=0; i<=CDDB_GENRE_MAX; i++)
-        if (strcasecmp(cddb_genre,cddb_genre_vs_id3_genre[i][0])==0)
+    for (i = 0; i <= CDDB_GENRE_MAX; i++)
+    {
+        if (g_ascii_strcasecmp (cddb_genre, cddb_genre_vs_id3_genre[i][0]) == 0)
+        {
             return cddb_genre_vs_id3_genre[i][1];
+        }
+    }
+
     return cddb_genre;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]