summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/csplit.c2
-rw-r--r--src/cut.c2
-rw-r--r--src/dircolors.c14
-rw-r--r--src/echo.c4
-rw-r--r--src/fold.c2
-rw-r--r--src/ls.c4
-rw-r--r--src/md5sum.c6
-rw-r--r--src/od.c8
-rw-r--r--src/pr.c4
-rw-r--r--src/pwd.c2
-rw-r--r--src/test.c4
-rw-r--r--src/uniq.c4
-rw-r--r--src/wc.c10
13 files changed, 30 insertions, 36 deletions
diff --git a/src/csplit.c b/src/csplit.c
index 3fdc3f061..1d0119868 100644
--- a/src/csplit.c
+++ b/src/csplit.c
@@ -1273,7 +1273,7 @@ get_format_conv_type (char **format_ptr)
break;
default:
- if (ISPRINT (ch))
+ if (isprint (ch))
error (EXIT_FAILURE, 0,
_("invalid conversion specifier in suffix: %c"), ch);
else
diff --git a/src/cut.c b/src/cut.c
index 0e656aa92..43eecb9dd 100644
--- a/src/cut.c
+++ b/src/cut.c
@@ -372,7 +372,7 @@ set_fields (const char *fieldstr)
else
initial = 1;
}
- else if (*fieldstr == ',' || ISBLANK (*fieldstr) || *fieldstr == '\0')
+ else if (*fieldstr == ',' || isblank (*fieldstr) || *fieldstr == '\0')
{
in_digits = false;
/* Ending the string, or this field/byte sublist. */
diff --git a/src/dircolors.c b/src/dircolors.c
index 7c388f06c..e30774ab2 100644
--- a/src/dircolors.c
+++ b/src/dircolors.c
@@ -155,8 +155,8 @@ parse_line (char const *line, char **keyword, char **arg)
*keyword = NULL;
*arg = NULL;
- for (p = line; ISSPACE (to_uchar (*p)); ++p)
- ;
+ for (p = line; isspace (to_uchar (*p)); ++p)
+ continue;
/* Ignore blank lines and shell-style comments. */
if (*p == '\0' || *p == '#')
@@ -164,7 +164,7 @@ parse_line (char const *line, char **keyword, char **arg)
keyword_start = p;
- while (!ISSPACE (to_uchar (*p)) && *p != '\0')
+ while (!isspace (to_uchar (*p)) && *p != '\0')
{
++p;
}
@@ -177,7 +177,7 @@ parse_line (char const *line, char **keyword, char **arg)
{
++p;
}
- while (ISSPACE (to_uchar (*p)));
+ while (isspace (to_uchar (*p)));
if (*p == '\0' || *p == '#')
return;
@@ -187,10 +187,8 @@ parse_line (char const *line, char **keyword, char **arg)
while (*p != '\0' && *p != '#')
++p;
- for (--p; ISSPACE (to_uchar (*p)); --p)
- {
- /* empty */
- }
+ for (--p; isspace (to_uchar (*p)); --p)
+ continue;
++p;
*arg = xstrndup (arg_start, p - arg_start);
diff --git a/src/echo.c b/src/echo.c
index a286a5189..5f8582cc0 100644
--- a/src/echo.c
+++ b/src/echo.c
@@ -218,12 +218,12 @@ just_echo:
case 'x':
{
unsigned char ch = *s;
- if (! ISXDIGIT (ch))
+ if (! isxdigit (ch))
goto not_an_escape;
s++;
c = hextobin (ch);
ch = *s;
- if (ISXDIGIT (ch))
+ if (isxdigit (ch))
{
s++;
c = c * 16 + hextobin (ch);
diff --git a/src/fold.c b/src/fold.c
index cc5424dee..cef98c1a8 100644
--- a/src/fold.c
+++ b/src/fold.c
@@ -176,7 +176,7 @@ fold_file (char *filename, size_t width)
while (logical_end)
{
--logical_end;
- if (ISBLANK (line_out[logical_end]))
+ if (isblank (to_uchar (line_out[logical_end])))
{
found_blank = true;
break;
diff --git a/src/ls.c b/src/ls.c
index be556f6a2..612411e8f 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -3659,7 +3659,7 @@ quote_name (FILE *out, const char *name, struct quoting_options const *options,
while (p < plimit)
{
- if (! ISPRINT (to_uchar (*p)))
+ if (! isprint (to_uchar (*p)))
*p = '?';
p++;
}
@@ -3680,7 +3680,7 @@ quote_name (FILE *out, const char *name, struct quoting_options const *options,
displayed_width = 0;
while (p < plimit)
{
- if (ISPRINT (to_uchar (*p)))
+ if (isprint (to_uchar (*p)))
displayed_width++;
p++;
}
diff --git a/src/md5sum.c b/src/md5sum.c
index cdd74921b..1ecd672b5 100644
--- a/src/md5sum.c
+++ b/src/md5sum.c
@@ -348,7 +348,7 @@ hex_digits (unsigned char const *s)
{
while (*s)
{
- if (!ISXDIGIT (*s))
+ if (!isxdigit (*s))
return false;
++s;
}
@@ -513,9 +513,9 @@ digest_check (const char *checkfile_name)
in check file. Ignore case of hex digits. */
for (cnt = 0; cnt < digest_bin_bytes; ++cnt)
{
- if (TOLOWER (hex_digest[2 * cnt])
+ if (tolower (hex_digest[2 * cnt])
!= bin2hex[bin_buffer[cnt] >> 4]
- || (TOLOWER (hex_digest[2 * cnt + 1])
+ || (tolower (hex_digest[2 * cnt + 1])
!= (bin2hex[bin_buffer[cnt] & 0xf])))
break;
}
diff --git a/src/od.c b/src/od.c
index 785326268..fe4da7ed1 100644
--- a/src/od.c
+++ b/src/od.c
@@ -497,7 +497,7 @@ dump_hexl_mode_trailer (size_t n_bytes, const char *block)
for (i = n_bytes; i > 0; i--)
{
unsigned char c = *block++;
- unsigned char c2 = (ISPRINT(c) ? c : '.');
+ unsigned char c2 = (isprint (c) ? c : '.');
putchar (c2);
}
putchar ('<');
@@ -576,7 +576,7 @@ print_ascii (size_t n_bytes, void const *block,
break;
default:
- sprintf (buf, (ISPRINT (c) ? " %c" : "%03o"), c);
+ sprintf (buf, (isprint (c) ? " %c" : "%03o"), c);
s = buf;
}
@@ -1469,7 +1469,7 @@ dump_strings (void)
free (buf);
return ok;
}
- if (!ISPRINT (c))
+ if (! isprint (c))
/* Found a non-printing. Try again starting with next char. */
goto tryline;
buf[i] = c;
@@ -1492,7 +1492,7 @@ dump_strings (void)
}
if (c == '\0')
break; /* It is; print this string. */
- if (!ISPRINT (c))
+ if (! isprint (c))
goto tryline; /* It isn't; give up on this string. */
buf[i++] = c; /* String continues; store it all. */
}
diff --git a/src/pr.c b/src/pr.c
index 23986ea6f..096758888 100644
--- a/src/pr.c
+++ b/src/pr.c
@@ -2326,7 +2326,7 @@ print_char (char c)
print_white_space ();
/* Nonprintables are assumed to have width 0, except '\b'. */
- if (!ISPRINT (to_uchar (c)))
+ if (! isprint (to_uchar (c)))
{
if (c == '\b')
--output_position;
@@ -2685,7 +2685,7 @@ char_to_clump (char c)
}
}
- else if (!ISPRINT (uc))
+ else if (! isprint (uc))
{
if (use_esc_sequence)
{
diff --git a/src/pwd.c b/src/pwd.c
index 235d53a17..4f16b738e 100644
--- a/src/pwd.c
+++ b/src/pwd.c
@@ -210,7 +210,7 @@ find_dir_entry (struct stat *dot_sb, struct file_name *file_name,
match is enough. */
if ( ! use_lstat || ent_sb.st_dev == dot_sb->st_dev)
{
- file_name_prepend (file_name, dp->d_name, NLENGTH (dp));
+ file_name_prepend (file_name, dp->d_name, _D_EXACT_NAMLEN (dp));
found = true;
break;
}
diff --git a/src/test.c b/src/test.c
index d6ae03611..b25436b1f 100644
--- a/src/test.c
+++ b/src/test.c
@@ -134,7 +134,7 @@ find_int (char const *string)
char const *p;
char const *number_start;
- for (p = string; ISBLANK (to_uchar (*p)); p++)
+ for (p = string; isblank (to_uchar (*p)); p++)
continue;
if (*p == '+')
@@ -152,7 +152,7 @@ find_int (char const *string)
{
while (ISDIGIT (*p))
p++;
- while (ISBLANK (to_uchar (*p)))
+ while (isblank (to_uchar (*p)))
p++;
if (!*p)
return number_start;
diff --git a/src/uniq.c b/src/uniq.c
index 4ea3fdeee..0d60961f6 100644
--- a/src/uniq.c
+++ b/src/uniq.c
@@ -198,9 +198,9 @@ find_field (const struct linebuffer *line)
for (count = 0; count < skip_fields && i < size; count++)
{
- while (i < size && ISBLANK (lp[i]))
+ while (i < size && isblank (lp[i]))
i++;
- while (i < size && !ISBLANK (lp[i]))
+ while (i < size && !isblank (lp[i]))
i++;
}
diff --git a/src/wc.c b/src/wc.c
index 1da5373e3..f533b7ca6 100644
--- a/src/wc.c
+++ b/src/wc.c
@@ -38,14 +38,10 @@
#endif
#if !defined iswspace && !HAVE_ISWSPACE
# define iswspace(wc) \
- ((wc) == to_uchar (wc) && ISSPACE (to_uchar (wc)))
+ ((wc) == to_uchar (wc) && isspace (to_uchar (wc)))
#endif
-/* Include this after wctype.h so that we `#undef' ISPRINT
- (from Solaris's euc.h, from widec.h, from wctype.h) before
- redefining and using it. */
#include "system.h"
-
#include "error.h"
#include "inttostr.h"
#include "quote.h"
@@ -474,10 +470,10 @@ wc (int fd, char const *file_x, struct fstatus *fstatus)
in_word = false;
break;
default:
- if (ISPRINT (to_uchar (p[-1])))
+ if (isprint (to_uchar (p[-1])))
{
linepos++;
- if (ISSPACE (to_uchar (p[-1])))
+ if (isspace (to_uchar (p[-1])))
goto word_separator;
in_word = true;
}