[MPlayer-cvslog] r30258 - trunk/subreader.c

zuxy subversion at mplayerhq.hu
Sun Jan 10 14:52:44 CET 2010


Author: zuxy
Date: Sun Jan 10 14:52:44 2010
New Revision: 30258

Log:
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.

Modified:
   trunk/subreader.c

Modified: trunk/subreader.c
==============================================================================
--- trunk/subreader.c	Sun Jan 10 14:32:37 2010	(r30257)
+++ trunk/subreader.c	Sun Jan 10 14:52:44 2010	(r30258)
@@ -1729,18 +1729,18 @@ char * strreplace( char * in,char * what
 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
 static int whiteonly(char *s)
 {
     while (*s) {
-	if (isalnum(*s)) return 0;
+	if (!isspace(*s)) return 0;
 	s++;
   }
     return 1;


More information about the MPlayer-cvslog mailing list