changeset 30216:30ac5dc10c44

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.
author zuxy
date Sun, 10 Jan 2010 13:52:44 +0000
parents fe9b742995ea
children 6d40c92e081e
files subreader.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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;