mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-18 08:52:41 +00:00
Remove duplicate strcasestr
This commit is contained in:
parent
aac21b1d11
commit
4a37c4e020
@ -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);
|
||||
}
|
||||
|
@ -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"),
|
||||
|
@ -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
|
||||
|
@ -13,6 +13,7 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <compat/strcasestr.h>
|
||||
#include <compat/strl.h>
|
||||
|
||||
#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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user