Index: trunk/src/kmk/make.h
===================================================================
--- trunk/src/kmk/make.h	(revision 1841)
+++ trunk/src/kmk/make.h	(revision 1842)
@@ -178,4 +178,23 @@
 #  define MY_PREDICT_TRUE(expr)  (expr)
 #  define MY_PREDICT_FALSE(expr) (expr)
+# endif
+#endif
+
+#ifdef KMK
+# include <ctype.h>
+# if 1 /* See if this speeds things up (Windows is doing this anyway, so,
+          we might as well try be consistent in speed + features).  */
+#  if 1
+#   define MY_IS_BLANK(ch)          ((ch) == ' ' || (ch) == '\t')
+#   define MY_IS_BLANK_OR_EOS(ch)   ((ch) == ' ' || (ch) == '\t' || (ch) == '\0')
+#  else
+#   define MY_IS_BLANK(ch)          (((ch) == ' ') | ((ch) == '\t'))
+#   define MY_IS_BLANK_OR_EOS(ch)   (((ch) == ' ') | ((ch) == '\t') | ((ch) == '\0'))
+#  endif
+#  undef isblank
+#  define isblank(ch)               MY_IS_BLANK(ch)
+# else
+#  define MY_IS_BLANK(ch)           isblank ((unsigned char)(ch))
+#  define MY_IS_BLANK_OR_EOS(ch)    (isblank ((unsigned char)(ch)) || (ch) == '\0')
 # endif
 #endif
Index: trunk/src/kmk/misc.c
===================================================================
--- trunk/src/kmk/misc.c	(revision 1841)
+++ trunk/src/kmk/misc.c	(revision 1842)
@@ -502,14 +502,14 @@
 
         ch0 = *s;
-        if (MY_PREDICT_FALSE(isblank(ch0) || ch0 == '\0'))
+        if (MY_PREDICT_FALSE(MY_IS_BLANK_OR_EOS(ch0)))
           return (char *)s;
         ch1 = s[1];
-        if (MY_PREDICT_FALSE(isblank(ch1) || ch1 == '\0'))
+        if (MY_PREDICT_FALSE(MY_IS_BLANK_OR_EOS(ch1)))
           return (char *)s + 1;
         ch2 = s[2];
-        if (MY_PREDICT_FALSE(isblank(ch2) || ch2 == '\0'))
+        if (MY_PREDICT_FALSE(MY_IS_BLANK_OR_EOS(ch2)))
           return (char *)s + 2;
         ch3 = s[3];
-        if (MY_PREDICT_FALSE(isblank(ch3) || ch3 == '\0'))
+        if (MY_PREDICT_FALSE(MY_IS_BLANK_OR_EOS(ch3)))
           return (char *)s + 3;
 
@@ -565,14 +565,14 @@
 
       ch0 = *s;
-      if (MY_PREDICT_FALSE(!isblank(ch0)))
+      if (MY_PREDICT_FALSE(!MY_IS_BLANK(ch0)))
           return (char *)s;
       ch1 = s[1];
-      if (MY_PREDICT_FALSE(!isblank(ch1)))
+      if (MY_PREDICT_TRUE(!MY_IS_BLANK(ch1)))
         return (char *)s + 1;
       ch2 = s[2];
-      if (MY_PREDICT_FALSE(!isblank(ch2)))
+      if (MY_PREDICT_FALSE(!MY_IS_BLANK(ch2)))
         return (char *)s + 2;
       ch3 = s[3];
-      if (MY_PREDICT_TRUE(!isblank(ch3)))
+      if (MY_PREDICT_TRUE(!MY_IS_BLANK(ch3)))
         return (char *)s + 3;
 
@@ -599,53 +599,73 @@
 
   /* skip blanks */
-  for (;;)
+# if 0 /* a moderate version */
+  for (;; p++)
+    {
+      unsigned char ch = *p;
+      if (!MY_IS_BLANK(ch))
+        {
+          if (!ch)
+            return NULL;
+          break;
+        }
+    }
+
+# else  /* (too) big unroll */
+  for (;; p += 4)
     {
       unsigned char ch0, ch1, ch2, ch3;
 
       ch0 = *p;
-      if (MY_PREDICT_FALSE(!isblank(ch0)))
+      if (MY_PREDICT_FALSE(!MY_IS_BLANK(ch0)))
         {
           if (!ch0)
-              return NULL;
+            return NULL;
           break;
         }
       ch1 = p[1];
-      if (MY_PREDICT_FALSE(!isblank(ch1)))
+      if (MY_PREDICT_TRUE(!MY_IS_BLANK(ch1)))
         {
           if (!ch1)
-              return NULL;
+            return NULL;
           p += 1;
           break;
         }
       ch2 = p[2];
-      if (MY_PREDICT_FALSE(!isblank(ch2)))
+      if (MY_PREDICT_FALSE(!MY_IS_BLANK(ch2)))
         {
           if (!ch2)
-              return NULL;
+            return NULL;
           p += 2;
           break;
         }
       ch3 = p[3];
-      if (MY_PREDICT_TRUE(!isblank(ch3)))
+      if (MY_PREDICT_TRUE(!MY_IS_BLANK(ch3)))
         {
           if (!ch3)
-              return NULL;
+            return NULL;
           p += 3;
           break;
         }
-      p += 4;
-    }
+    }
+# endif
 
   /* skip ahead until EOS or blanks. */
-  e = p + 1;
-  for (;;)
+# if 0 /* a moderate version */
+  for (e = p + 1;  ; e++)
+    {
+      unsigned char ch = *e;
+      if (MY_PREDICT_FALSE(MY_IS_BLANK_OR_EOS(ch)))
+        break;
+    }
+# else  /* (too) big unroll */
+  for (e = p + 1;  ; e += 4)
     {
       unsigned char ch0, ch1, ch2, ch3;
 
       ch0 = *e;
-      if (MY_PREDICT_FALSE(isblank(ch0) || ch0 == '\0'))
+      if (MY_PREDICT_FALSE(MY_IS_BLANK_OR_EOS(ch0)))
         break;
       ch1 = e[1];
-      if (MY_PREDICT_FALSE(isblank(ch1) || ch1 == '\0'))
+      if (MY_PREDICT_FALSE(MY_IS_BLANK_OR_EOS(ch1)))
         {
           e += 1;
@@ -653,5 +673,5 @@
         }
       ch2 = e[2];
-      if (MY_PREDICT_FALSE(isblank(ch2) || ch2 == '\0'))
+      if (MY_PREDICT_FALSE(MY_IS_BLANK_OR_EOS(ch2)))
         {
           e += 2;
@@ -659,13 +679,13 @@
         }
       ch3 = e[3];
-      if (MY_PREDICT_FALSE(isblank(ch3) || ch3 == '\0'))
+      if (MY_PREDICT_FALSE(MY_IS_BLANK_OR_EOS(ch3)))
         {
           e += 3;
           break;
         }
-      e += 4;
-    }
-
+    }
+# endif
   *ptr = e;
+
   if (lengthptr != 0)
     *lengthptr = e - p;
