]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* util/ieee1275/ofpath.c (my_isdigit): New function.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 2 Mar 2012 10:21:01 +0000 (11:21 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 2 Mar 2012 10:21:01 +0000 (11:21 +0100)
(trailing_digits): Use my_isdigit.
(strip_trailing_digits): Likewise.

ChangeLog
util/ieee1275/ofpath.c

index a01007d81cb9c398c5766f4ab5375c7bc84b2dfa..2852c52afb6c1641ce32ce536505b98b7591dabc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-03-02  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * util/ieee1275/ofpath.c (my_isdigit): New function.
+       (trailing_digits): Use my_isdigit.
+       (strip_trailing_digits): Likewise.
+
 2012-03-02  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * util/resolve.c (read_dep_list): Use grub_isspace instead of isspace.
index 34132a267c3f17e0bb7574256155a0b6e5d15091..03baceda83bec13b9b2eb0a3ceb54df916be5357 100644 (file)
@@ -185,6 +185,12 @@ block_device_get_sysfs_path_and_link(const char *devicenode)
   return ret;
 }
 
+static inline int
+my_isdigit (int c)
+{
+  return (c >= '0' && c <= '9');
+}
+
 static const char *
 trailing_digits (const char *p)
 {
@@ -193,7 +199,7 @@ trailing_digits (const char *p)
   end = p + strlen(p) - 1;
   while (end >= p)
     {
-      if (! isdigit(*end))
+      if (! my_isdigit(*end))
        break;
       end--;
     }
@@ -410,7 +416,7 @@ strip_trailing_digits (const char *p)
   end = new + strlen(new) - 1;
   while (end >= new)
     {
-      if (! isdigit(*end))
+      if (! my_isdigit(*end))
        break;
       *end-- = '\0';
     }