The following commit has been merged in the master branch:
commit 896b469211b21a01c847946240f2d003d3dfb71b
Author: Guillem Jover <[email protected]>
Date:   Fri Jul 10 21:50:56 2009 +0200

    libdpkg: Use isblank instead of ad-hoc comparisons

diff --git a/lib/parsehelp.c b/lib/parsehelp.c
index af2fd1f..63de266 100644
--- a/lib/parsehelp.c
+++ b/lib/parsehelp.c
@@ -221,14 +221,17 @@ const char *parseversion(struct versionrevision 
*rversion, const char *string) {
   if (!*string) return _("version string is empty");
 
   /* trim leading and trailing space */
-  while (*string && (*string == ' ' || *string == '\t') ) string++;
+  while (*string && isblank(*string))
+    string++;
   /* string now points to the first non-whitespace char */
   end = string;
   /* find either the end of the string, or a whitespace char */
-  while (*end && *end != ' ' && *end != '\t' ) end++;
+  while (*end && !isblank(*end))
+    end++;
   /* check for extra chars after trailing space */
   ptr = end;
-  while (*ptr && ( *ptr == ' ' || *ptr == '\t' ) ) ptr++;
+  while (*ptr && isblank(*ptr))
+    ptr++;
   if (*ptr) return _("version string has embedded spaces");
 
   colon= strchr(string,':');

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to