]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(print_formatted, print_esc): Define ISXDIGIT and ISXDIGIT and use
authorJim Meyering <jim@meyering.net>
Mon, 7 Dec 1992 05:32:19 +0000 (05:32 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 7 Dec 1992 05:32:19 +0000 (05:32 +0000)
them instead of isdigit and isxdigit.

src/printf.c

index a9979a6d8509456d94e5f7100be8675460e0043a..1c43c077399875cf3370bd7f3efe5ded1ceea58e 100644 (file)
 #include <sys/types.h>
 #include "system.h"
 
+#ifndef isascii
+#define isascii(c) 1
+#endif
+
+#define ISDIGIT(c) (isascii (c) && isdigit (c))
+#define ISXDIGIT(c) (isascii (c) && isxdigit (c))
+
 #ifndef STDC_HEADERS
 double strtod ();
 long strtol ();
@@ -168,7 +175,7 @@ print_formatted (format, argc, argv)
                field_width = 0;
            }
          else
-           while (isdigit (*f))
+           while (ISDIGIT (*f))
              {
                ++f;
                ++direc_length;
@@ -191,7 +198,7 @@ print_formatted (format, argc, argv)
                    precision = 0;
                }
              else
-               while (isdigit (*f))
+               while (ISDIGIT (*f))
                  {
                    ++f;
                    ++direc_length;
@@ -245,7 +252,7 @@ print_esc (escstart)
   if (*p == 'x')
     {
       for (esc_length = 0, ++p;
-          esc_length < 3 && isxdigit (*p);
+          esc_length < 3 && ISXDIGIT (*p);
           ++esc_length, ++p)
        esc_value = esc_value * 16 + hextobin (*p);
       if (esc_length == 0)