Use string_ends_with and string_starts_with

This commit is contained in:
twinaphex 2020-05-22 20:57:48 +02:00
parent 9f4b3b0fc6
commit 31674f9246
3 changed files with 5 additions and 5 deletions

View File

@ -5346,7 +5346,7 @@ static void netplay_refresh_rooms_cb(retro_task_t *task,
data->data = new_data;
data->data[data->len] = '\0';
if (!strstr(data->data, "registry.lpl"))
if (!string_ends_with(data->data, "registry.lpl"))
{
if (string_is_empty(data->data))
netplay_room_count = 0;

View File

@ -156,7 +156,7 @@ static int action_get_title_dropdown_item(
if (string_is_empty(path))
return 0;
if (strstr(path, "core_option_"))
if (string_starts_with(path, "core_option_"))
{
/* This is a core options item */
struct string_list *tmp_str_list = string_split(path, "_");
@ -1406,7 +1406,7 @@ int menu_cbs_init_bind_title(menu_file_list_cbs_t *cbs,
* treatment, since the label has the format:
* <MENU_ENUM_LABEL_DEFERRED_RDB_ENTRY_DETAIL>|<entry_name>
* i.e. cannot use a normal string_is_equal() */
if (strstr(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_RDB_ENTRY_DETAIL)))
if (string_starts_with(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_RDB_ENTRY_DETAIL)))
{
BIND_ACTION_GET_TITLE(cbs, action_get_title_list_rdb_entry_database_info);
return 0;

View File

@ -266,7 +266,7 @@ static void task_netplay_crc_scan_handler(retro_task_t *task)
const char *lpl_path = state->lpl_list->elems[i].data;
/* skip files without .lpl file extension */
if (!strstr(lpl_path, ".lpl"))
if (!string_ends_with(lpl_path, ".lpl"))
continue;
RARCH_LOG("[Lobby] Searching playlist: %s\n", lpl_path);
@ -340,7 +340,7 @@ static void task_netplay_crc_scan_handler(retro_task_t *task)
const char *lpl_path = state->lpl_list->elems[j].data;
/* skip files without .lpl file extension */
if (!strstr(lpl_path, ".lpl"))
if (!string_ends_with(lpl_path, ".lpl"))
continue;
RARCH_LOG("[Lobby] Searching content %d/%d (%s) in playlist: %s\n", i + 1, game_list->size, game_list->elems[i].data, lpl_path);