From 4a4de389d10c00ea2a1b250acaa104b8c96f88a6 Mon Sep 17 00:00:00 2001 From: radius Date: Sat, 9 Sep 2017 00:24:59 -0500 Subject: [PATCH] cut on underscores too, might be required to add other delimiters so it doesn't get stuck on an endless loop on long strings --- libretro-common/string/stdstring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libretro-common/string/stdstring.c b/libretro-common/string/stdstring.c index 88a436f128..bec5629c46 100644 --- a/libretro-common/string/stdstring.c +++ b/libretro-common/string/stdstring.c @@ -188,7 +188,7 @@ char *word_wrap(char* buffer, const char *string, int line_width, bool unicode) } /* check for whitespace */ - if (string[i] == ' ') + if (string[i] == ' ' || string[i] == '_') { buffer[i] = '\n'; i++; @@ -200,7 +200,7 @@ char *word_wrap(char* buffer, const char *string, int line_width, bool unicode) /* check for nearest whitespace back in string */ for (k = i; k > 0; k--) { - if (string[k] != ' ') + if (string[k] != ' ' || string[k] != '_') continue; buffer[k] = '\n';