From 6e2730fb4dfe043680184734a78b156344b49c7e Mon Sep 17 00:00:00 2001 From: Led Date: Sat, 25 May 2013 05:47:09 +0300 Subject: [PATCH] fixed subreader --- MPlayer/sub/subreader.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/MPlayer/sub/subreader.c b/MPlayer/sub/subreader.c index 3c815d1320..a1f05c4d63 100644 --- a/MPlayer/sub/subreader.c +++ b/MPlayer/sub/subreader.c @@ -1888,22 +1888,16 @@ char * strreplace( char * in,char * what,char * whereof ) static void strcpy_trim(char *d, const char *s) { // skip leading whitespace - while (*s && isspace(*s)) { - s++; - } - for (;;) { + for (; *s && isascii(*s) && !isalnum(*s); s++); + for (;; d++) { // copy word - while (*s && !isspace(*s)) { - *d = tolower(*s); - s++; d++; - } + for (; *s && (!isascii(*s) || isalnum(*s)); s++, d++) + *d = *s; if (*s == 0) break; // trim excess whitespace - while (*s && isspace(*s)) { - s++; - } + for (; *s && isascii(*s) && !isalnum(*s); s++); if (*s == 0) break; - *d++ = ' '; + *d = ' '; } *d = 0; } -- 2.33.7