[gnet-devel] [PATCH] use GLib's isspace



The comment for the locally-defined ISSPACE() macro seems to indicate the same purpose as g_ascii_isspace(), so I made the replacement.

I have not, however, verified the correctness against the relevant RFCs. I'm hoping the code's author could give this a review...

	Jeff


Index: src/uri.c
===================================================================
--- src/uri.c	(revision 481)
+++ src/uri.c	(working copy)
@@ -100,11 +100,6 @@
 */
 
 
-/* our own ISSPACE.  ANSI isspace is locale dependent */
-#define ISSPACE(C) (((C) >= 9 && (C) <= 13) || (C) == ' ')
-
-
-
 /**
  *  gnet_uri_new
  *  @uri: URI string
@@ -132,7 +127,7 @@
 
   /* Skip initial whitespace */
   p = uri;
-  while (*p && ISSPACE((int)*p))
+  while (*p && g_ascii_isspace((int)*p))
     ++p;
   if (!*p)	/* Error if it's just a string of space */
     return NULL;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]