>From 5b5d541dfc744184c3faa41f7d21bb2cc30de88e Mon Sep 17 00:00:00 2001 From: "A. Gordon" Date: Tue, 15 Jul 2014 12:25:03 -0400 Subject: [PATCH] numfmt: use c-locale comparisons * src/numfmt.c: replace isdigit(),isblank() with c_isdigit(),c_isblank() - as they are safer for non-locale comparisons. Triggered a compilation warning on Cygwin, as explained here: http://lists.gnu.org/archive/html/coreutils/2014-07/msg00087.html --- src/numfmt.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/numfmt.c b/src/numfmt.c index 6091bb6..94a9d7a 100644 --- a/src/numfmt.c +++ b/src/numfmt.c @@ -23,6 +23,7 @@ #include "mbsalign.h" #include "argmatch.h" +#include "c-ctype.h" #include "error.h" #include "quote.h" #include "system.h" @@ -454,7 +455,7 @@ simple_strtod_int (const char *input_str, *negative = false; *endptr = (char *) input_str; - while (*endptr && isdigit (**endptr)) + while (*endptr && c_isdigit (**endptr)) { int digit = (**endptr) - '0'; @@ -600,7 +601,7 @@ simple_strtod_human (const char *input_str, /* process suffix. */ /* Skip any blanks between the number and suffix. */ - while (isblank (**endptr)) + while (c_isblank (**endptr)) (*endptr)++; if (!valid_suffix (**endptr)) @@ -1174,7 +1175,7 @@ process_suffixed_number (char *text, long double *result, size_t *precision) /* Skip white space - always. */ char *p = text; - while (*p && isblank (*p)) + while (*p && c_isblank (*p)) ++p; const unsigned int skip_count = text - p; @@ -1229,9 +1230,9 @@ skip_fields (char *buf, int fields) else while (*ptr && fields--) { - while (*ptr && isblank (*ptr)) + while (*ptr && c_isblank (*ptr)) ++ptr; - while (*ptr && !isblank (*ptr)) + while (*ptr && !c_isblank (*ptr)) ++ptr; } return ptr; -- 1.9.1