]> granicus.if.org Git - curl/commitdiff
use our own ISBLANK macro
authorYang Tse <yangsita@gmail.com>
Tue, 13 Feb 2007 17:47:27 +0000 (17:47 +0000)
committerYang Tse <yangsita@gmail.com>
Tue, 13 Feb 2007 17:47:27 +0000 (17:47 +0000)
ares/setup_once.h
lib/cookie.c
lib/setup_once.h

index 0ff1d65a17dedeb5ef70293217235b8206ea864f..6cfa526f71bc40159c946a5e076d4688f17967f7 100644 (file)
  */
 
 #define ISSPACE(x)  (isspace((int)  ((unsigned char)x)))
+#define ISBLANK(x)  (isblank((int)  ((unsigned char)x)))
 #define ISDIGIT(x)  (isdigit((int)  ((unsigned char)x)))
 #define ISALNUM(x)  (isalnum((int)  ((unsigned char)x)))
 #define ISXDIGIT(x) (isxdigit((int) ((unsigned char)x)))
index 2856ad882d7aa3fd34d8c98a24d96c4885929bc8..41a366d2da217ac068f7e198eefd85d302e87a49 100644 (file)
@@ -102,7 +102,6 @@ Example set of cookies:
 #include "memdebug.h"
 #endif
 
-#define my_isspace(x) ((x == ' ') || (x == '\t'))
 
 static void freecookie(struct Cookie *co)
 {
@@ -206,7 +205,7 @@ Curl_cookie_add(struct SessionHandle *data,
 
     semiptr=strchr(lineptr, ';'); /* first, find a semicolon */
 
-    while(*lineptr && my_isspace(*lineptr))
+    while(*lineptr && ISBLANK(*lineptr))
       lineptr++;
 
     ptr = lineptr;
@@ -229,14 +228,14 @@ Curl_cookie_add(struct SessionHandle *data,
 
           /* Strip off trailing whitespace from the 'what' */
           size_t len=strlen(what);
-          while(len && my_isspace(what[len-1])) {
+          while(len && ISBLANK(what[len-1])) {
             what[len-1]=0;
             len--;
           }
 
           /* Skip leading whitespace from the 'what' */
           whatptr=what;
-          while(my_isspace(*whatptr)) {
+          while(*whatptr && ISBLANK(*whatptr)) {
             whatptr++;
           }
 
@@ -378,7 +377,7 @@ Curl_cookie_add(struct SessionHandle *data,
       }
 
       ptr=semiptr+1;
-      while(ptr && *ptr && my_isspace(*ptr))
+      while(ptr && *ptr && ISBLANK(*ptr))
         ptr++;
       semiptr=strchr(ptr, ';'); /* now, find the next semicolon */
 
@@ -702,7 +701,7 @@ struct CookieInfo *Curl_cookie_init(struct SessionHandle *data,
           lineptr=line;
           headerline=FALSE;
         }
-        while(*lineptr && my_isspace(*lineptr))
+        while(*lineptr && ISBLANK(*lineptr))
           lineptr++;
 
         Curl_cookie_add(data, c, headerline, lineptr, NULL, NULL);
index 3d3235edeeb98234d7d9850f3667b62e7b703326..445bb970b9c91966b2be8b438d4b13a2497e9f37 100644 (file)
  */
 
 #define ISSPACE(x)  (isspace((int)  ((unsigned char)x)))
+#define ISBLANK(x)  (isblank((int)  ((unsigned char)x)))
 #define ISDIGIT(x)  (isdigit((int)  ((unsigned char)x)))
 #define ISALNUM(x)  (isalnum((int)  ((unsigned char)x)))
 #define ISXDIGIT(x) (isxdigit((int) ((unsigned char)x)))