From 9d0e5c012e0b3027f42519d6e23c51020bd490b4 Mon Sep 17 00:00:00 2001 From: markwkidd Date: Tue, 15 Nov 2016 15:57:51 -0500 Subject: [PATCH] change thumbnail filename scrub to use strpbrk() --- menu/drivers/xmb.c | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index d386d554fb..9b804b52ab 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -865,40 +865,13 @@ static void xmb_update_thumbnail_path(void *data, unsigned i) char *scrub_char_pointer = 0; tmp = strdup(entry.path); - while ((scrub_char_pointer = strchr(tmp, '&')) != NULL) { - *scrub_char_pointer = '_'; - } - while ((scrub_char_pointer = strchr(tmp, '\\')) != NULL) { - *scrub_char_pointer = '_'; - } - while ((scrub_char_pointer = strchr(tmp, '/')) != NULL) { - *scrub_char_pointer = '_'; - } - while ((scrub_char_pointer = strchr(tmp, '?')) != NULL) { - *scrub_char_pointer = '_'; - } - while ((scrub_char_pointer = strchr(tmp, ':')) != NULL) { - *scrub_char_pointer = '_'; - } - while ((scrub_char_pointer = strchr(tmp, '`')) != NULL) { - *scrub_char_pointer = '_'; - } - while ((scrub_char_pointer = strchr(tmp, '<')) != NULL) { - *scrub_char_pointer = '_'; - } - while ((scrub_char_pointer = strchr(tmp, '>')) != NULL) { - *scrub_char_pointer = '_'; - } - while ((scrub_char_pointer = strchr(tmp, '*')) != NULL) { - *scrub_char_pointer = '_'; - } - while ((scrub_char_pointer = strchr(tmp, '|')) != NULL) { + while(scrub_char_pointer = strpbrk(tmp, "&*/:`<>?\|")) + { *scrub_char_pointer = '_'; } /* Look for thumbnail file with the scrubbed filename */ - - if (tmp) + if (tmp) { char tmp_new[PATH_MAX_LENGTH];