mirror of
https://github.com/mpv-player/mpv
synced 2025-01-05 03:06:28 +01:00
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. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30258 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
e51a1598b4
commit
534f6aa6b5
@ -1729,18 +1729,18 @@ char * strreplace( char * in,char * what,char * whereof )
|
||||
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 void strcpy_get_ext(char *d, char *s)
|
||||
static int whiteonly(char *s)
|
||||
{
|
||||
while (*s) {
|
||||
if (isalnum(*s)) return 0;
|
||||
if (!isspace(*s)) return 0;
|
||||
s++;
|
||||
}
|
||||
return 1;
|
||||
|
Loading…
Reference in New Issue
Block a user