* util/ieee1275/ofpath.c (my_isdigit): New function.

(trailing_digits): Use my_isdigit.
	(strip_trailing_digits): Likewise.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-03-02 11:21:01 +01:00
parent 88d51eff35
commit 48afcb75fa
2 changed files with 14 additions and 2 deletions

View file

@ -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> 2012-03-02 Vladimir Serbinenko <phcoder@gmail.com>
* util/resolve.c (read_dep_list): Use grub_isspace instead of isspace. * util/resolve.c (read_dep_list): Use grub_isspace instead of isspace.

View file

@ -185,6 +185,12 @@ block_device_get_sysfs_path_and_link(const char *devicenode)
return ret; return ret;
} }
static inline int
my_isdigit (int c)
{
return (c >= '0' && c <= '9');
}
static const char * static const char *
trailing_digits (const char *p) trailing_digits (const char *p)
{ {
@ -193,7 +199,7 @@ trailing_digits (const char *p)
end = p + strlen(p) - 1; end = p + strlen(p) - 1;
while (end >= p) while (end >= p)
{ {
if (! isdigit(*end)) if (! my_isdigit(*end))
break; break;
end--; end--;
} }
@ -410,7 +416,7 @@ strip_trailing_digits (const char *p)
end = new + strlen(new) - 1; end = new + strlen(new) - 1;
while (end >= new) while (end >= new)
{ {
if (! isdigit(*end)) if (! my_isdigit(*end))
break; break;
*end-- = '\0'; *end-- = '\0';
} }