# HG changeset patch # User zuxy # Date 1263131564 0 # Node ID 30ac5dc10c44531b92d9b896eb11bd30fa6b8ac7 # Parent fe9b742995eaf0caa9e117199034936620258f50 Use !isspace() to replace isalnum() to avoid filename mismatch under MBCS locale like those in East Asia where most glyphs are neither alphabetical nor numerical. diff -r fe9b742995ea -r 30ac5dc10c44 subreader.c --- a/subreader.c Sun Jan 10 13:32:37 2010 +0000 +++ b/subreader.c Sun Jan 10 13:52:44 2010 +0000 @@ -1729,18 +1729,18 @@ static void strcpy_trim(char *d, char *s) { // skip leading whitespace - while (*s && !isalnum(*s)) { + while (*s && isspace(*s)) { s++; } for (;;) { // copy word - while (*s && isalnum(*s)) { + while (*s && !isspace(*s)) { *d = tolower(*s); s++; d++; } if (*s == 0) break; // trim excess whitespace - while (*s && !isalnum(*s)) { + while (*s && isspace(*s)) { s++; } if (*s == 0) break; @@ -1779,7 +1779,7 @@ static int whiteonly(char *s) { while (*s) { - if (isalnum(*s)) return 0; + if (!isspace(*s)) return 0; s++; } return 1;