mirror of
https://github.com/libretro/RetroArch
synced 2024-12-26 03:22:56 +00:00
Don't use string_trim_whitespace
This commit is contained in:
parent
ca7e53e3ca
commit
99c7e08445
@ -229,7 +229,8 @@ static void logiqx_dat_sanitise_element_data(
|
|||||||
|
|
||||||
/* Element data includes leading/trailing
|
/* Element data includes leading/trailing
|
||||||
* newline characters - trim them away */
|
* newline characters - trim them away */
|
||||||
string_trim_whitespace(sanitised_data);
|
string_trim_whitespace_right(sanitised_data);
|
||||||
|
string_trim_whitespace_left(sanitised_data);
|
||||||
|
|
||||||
if (string_is_empty(sanitised_data))
|
if (string_is_empty(sanitised_data))
|
||||||
return;
|
return;
|
||||||
|
@ -145,7 +145,8 @@ static bool m3u_file_load(m3u_file_t *m3u_file)
|
|||||||
strlcpy(
|
strlcpy(
|
||||||
entry_label, line + STRLEN_CONST(M3U_FILE_NONSTD_LABEL),
|
entry_label, line + STRLEN_CONST(M3U_FILE_NONSTD_LABEL),
|
||||||
sizeof(entry_label));
|
sizeof(entry_label));
|
||||||
string_trim_whitespace(entry_label);
|
string_trim_whitespace_right(entry_label);
|
||||||
|
string_trim_whitespace_left(entry_label);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* > '#EXTINF:' */
|
/* > '#EXTINF:' */
|
||||||
@ -164,7 +165,8 @@ static bool m3u_file_load(m3u_file_t *m3u_file)
|
|||||||
if (!string_is_empty(label_ptr))
|
if (!string_is_empty(label_ptr))
|
||||||
{
|
{
|
||||||
strlcpy(entry_label, label_ptr, sizeof(entry_label));
|
strlcpy(entry_label, label_ptr, sizeof(entry_label));
|
||||||
string_trim_whitespace(entry_label);
|
string_trim_whitespace_right(entry_label);
|
||||||
|
string_trim_whitespace_left(entry_label);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -190,7 +192,8 @@ static bool m3u_file_load(m3u_file_t *m3u_file)
|
|||||||
entry_path, line,
|
entry_path, line,
|
||||||
((len < PATH_MAX_LENGTH ?
|
((len < PATH_MAX_LENGTH ?
|
||||||
len : PATH_MAX_LENGTH) * sizeof(char)));
|
len : PATH_MAX_LENGTH) * sizeof(char)));
|
||||||
string_trim_whitespace(entry_path);
|
string_trim_whitespace_right(entry_path);
|
||||||
|
string_trim_whitespace_left(entry_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get entry_label segment */
|
/* Get entry_label segment */
|
||||||
@ -198,14 +201,16 @@ static bool m3u_file_load(m3u_file_t *m3u_file)
|
|||||||
if (*token_ptr != '\0')
|
if (*token_ptr != '\0')
|
||||||
{
|
{
|
||||||
strlcpy(entry_label, token_ptr, sizeof(entry_label));
|
strlcpy(entry_label, token_ptr, sizeof(entry_label));
|
||||||
string_trim_whitespace(entry_label);
|
string_trim_whitespace_right(entry_label);
|
||||||
|
string_trim_whitespace_left(entry_label);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Just a normal file name/path */
|
/* Just a normal file name/path */
|
||||||
strlcpy(entry_path, line, sizeof(entry_path));
|
strlcpy(entry_path, line, sizeof(entry_path));
|
||||||
string_trim_whitespace(entry_path);
|
string_trim_whitespace_right(entry_path);
|
||||||
|
string_trim_whitespace_left(entry_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add entry to file
|
/* Add entry to file
|
||||||
|
@ -191,7 +191,8 @@ static void manual_content_scan_scrub_file_exts(char *file_exts)
|
|||||||
|
|
||||||
string_remove_all_chars(file_exts, '.');
|
string_remove_all_chars(file_exts, '.');
|
||||||
string_to_lower(file_exts);
|
string_to_lower(file_exts);
|
||||||
string_trim_whitespace(file_exts);
|
string_trim_whitespace_right(file_exts);
|
||||||
|
string_trim_whitespace_left(file_exts);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Removes invalid characters from
|
/* Removes invalid characters from
|
||||||
|
@ -7176,12 +7176,13 @@ static void rgui_update_menu_sublabel(rgui_t *rgui, size_t selection)
|
|||||||
|
|
||||||
while (tok)
|
while (tok)
|
||||||
{
|
{
|
||||||
const char *line = string_trim_whitespace(tok);
|
string_trim_whitespace_right(tok);
|
||||||
if (!string_is_empty(line))
|
string_trim_whitespace_left(tok);
|
||||||
|
if (!string_is_empty(tok))
|
||||||
{
|
{
|
||||||
if (!prev_line_empty)
|
if (!prev_line_empty)
|
||||||
strlcat(rgui->menu_sublabel, sublabel_spacer, sizeof(rgui->menu_sublabel));
|
strlcat(rgui->menu_sublabel, sublabel_spacer, sizeof(rgui->menu_sublabel));
|
||||||
strlcat(rgui->menu_sublabel, line, sizeof(rgui->menu_sublabel));
|
strlcat(rgui->menu_sublabel, tok, sizeof(rgui->menu_sublabel));
|
||||||
prev_line_empty = false;
|
prev_line_empty = false;
|
||||||
}
|
}
|
||||||
tok = strtok_r(NULL, "\n", &save);
|
tok = strtok_r(NULL, "\n", &save);
|
||||||
|
@ -110,15 +110,17 @@ static void nmcli_scan(void *data)
|
|||||||
wifi_network_info_t entry;
|
wifi_network_info_t entry;
|
||||||
memset(&entry, 0, sizeof(entry));
|
memset(&entry, 0, sizeof(entry));
|
||||||
|
|
||||||
string_trim_whitespace(line);
|
string_trim_whitespace_right(line);
|
||||||
|
string_trim_whitespace_left(line);
|
||||||
if (!line || line[0] == '\0')
|
if (!line || line[0] == '\0')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (line[0] == '*')
|
if (line[0] == '*')
|
||||||
{
|
{
|
||||||
entry.connected = true;
|
entry.connected = true;
|
||||||
line[0] = ' ';
|
line[0] = ' ';
|
||||||
string_trim_whitespace(line);
|
string_trim_whitespace_right(line);
|
||||||
|
string_trim_whitespace_left(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
strlcpy(entry.ssid, line, sizeof(entry.ssid));
|
strlcpy(entry.ssid, line, sizeof(entry.ssid));
|
||||||
|
@ -184,7 +184,8 @@ bool natt_device_next(struct natt_discovery *discovery,
|
|||||||
*lnbreak++ = '\0';
|
*lnbreak++ = '\0';
|
||||||
|
|
||||||
/* This also gets rid of any trailing carriage return. */
|
/* This also gets rid of any trailing carriage return. */
|
||||||
string_trim_whitespace(data);
|
string_trim_whitespace_right(data);
|
||||||
|
string_trim_whitespace_left(data);
|
||||||
|
|
||||||
if (string_starts_with_case_insensitive(data, "Location:"))
|
if (string_starts_with_case_insensitive(data, "Location:"))
|
||||||
{
|
{
|
||||||
|
@ -697,7 +697,8 @@ int detect_scd_game(intfstream_t *fd, char *s, size_t len, const char *filename)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string_trim_whitespace(raw_game_id);
|
string_trim_whitespace_right(raw_game_id);
|
||||||
|
string_trim_whitespace_left(raw_game_id);
|
||||||
strlcpy(s, raw_game_id, len);
|
strlcpy(s, raw_game_id, len);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -742,7 +743,8 @@ int detect_sat_game(intfstream_t *fd, char *s, size_t len, const char *filename)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
string_trim_whitespace(raw_game_id);
|
string_trim_whitespace_right(raw_game_id);
|
||||||
|
string_trim_whitespace_left(raw_game_id);
|
||||||
|
|
||||||
/** Dissect this raw serial into parts **/
|
/** Dissect this raw serial into parts **/
|
||||||
length = strlen(raw_game_id);
|
length = strlen(raw_game_id);
|
||||||
@ -832,7 +834,8 @@ int detect_dc_game(intfstream_t *fd, char *s, size_t len, const char *filename)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
string_trim_whitespace(raw_game_id);
|
string_trim_whitespace_right(raw_game_id);
|
||||||
|
string_trim_whitespace_left(raw_game_id);
|
||||||
string_replace_multi_space_with_single_space(raw_game_id);
|
string_replace_multi_space_with_single_space(raw_game_id);
|
||||||
string_replace_whitespace_with_single_character(raw_game_id, '-');
|
string_replace_whitespace_with_single_character(raw_game_id, '-');
|
||||||
length = strlen(raw_game_id);
|
length = strlen(raw_game_id);
|
||||||
|
Loading…
Reference in New Issue
Block a user