From 4a37c4e0203cf0c63a725fe732289a5be134db63 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 2 Jun 2015 16:49:35 +0200 Subject: [PATCH] Remove duplicate strcasestr --- libretro-common/compat/compat.c | 25 --------------------- libretro-common/include/compat/strcasestr.h | 3 +-- libretro-common/include/compat/strl.h | 2 -- tasks/task_database.c | 3 ++- 4 files changed, 3 insertions(+), 30 deletions(-) diff --git a/libretro-common/compat/compat.c b/libretro-common/compat/compat.c index 3a6ddd460e..3b51123d7b 100644 --- a/libretro-common/compat/compat.c +++ b/libretro-common/compat/compat.c @@ -364,28 +364,3 @@ char *rarch_strtok_r__(char *str, const char *delim, char **saveptr) } #endif - -/* - * Find the first occurrence of find in s, ignore case. - */ -char *rarch_strcasestr(const char *s, const char *find) -{ - char c, sc; - size_t len; - - if ((c = *find++) != 0) - { - c = tolower((unsigned char)c); - len = strlen(find); - do - { - do - { - if ((sc = *s++) == 0) - return (NULL); - }while ((char)tolower((unsigned char)sc) != c); - }while (strncasecmp(s, find, len) != 0); - s--; - } - return ((char *)s); -} diff --git a/libretro-common/include/compat/strcasestr.h b/libretro-common/include/compat/strcasestr.h index 707b00c8e0..bd36835eea 100644 --- a/libretro-common/include/compat/strcasestr.h +++ b/libretro-common/include/compat/strcasestr.h @@ -1,8 +1,7 @@ /* Copyright (C) 2010-2015 The RetroArch team * * --------------------------------------------------------------------------------------- - * The following license statement only applies to this file (strcasestr.h). - * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (strcasestr.h). * --------------------------------------------------------------------------------------- * * Permission is hereby granted, free of charge, * to any person obtaining a copy of this software and associated documentation files (the "Software"), diff --git a/libretro-common/include/compat/strl.h b/libretro-common/include/compat/strl.h index 0f14cb18c5..14a0c03204 100644 --- a/libretro-common/include/compat/strl.h +++ b/libretro-common/include/compat/strl.h @@ -46,8 +46,6 @@ size_t strlcat(char *dest, const char *source, size_t size); #endif -char *rarch_strcasestr(const char *s, const char *find); - #ifdef __cplusplus } #endif diff --git a/tasks/task_database.c b/tasks/task_database.c index 4b62f218f5..6c5f0402b4 100644 --- a/tasks/task_database.c +++ b/tasks/task_database.c @@ -13,6 +13,7 @@ * If not, see . */ +#include #include #include "../dir_list_special.h" @@ -240,7 +241,7 @@ static int database_info_iterate_crc_lookup( entry_state_crc, db_info_entry->crc32, db_info_entry->name); #endif - if (rarch_strcasestr(entry_state_crc, db_info_entry->crc32)) + if (strcasestr(entry_state_crc, db_info_entry->crc32)) database_info_list_iterate_found_match(db_state, db, zip_entry); } }