]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: STREQ → streq
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 17 Sep 2025 16:12:23 +0000 (09:12 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 17 Sep 2025 19:20:24 +0000 (12:20 -0700)
Use new Gnulib streq function instead of rolling our own macro.
* bootstrap.conf (gnulib_modules): Add stringeq.
* src/rm.c (main): Don’t assume streq is a macro that expands to (...),
as it is now a function.
* src/system.h:
* tests/df/no-mtab-status.sh, tests/df/skip-duplicates.sh:
(STREQ): Remove.  All uses replaced by streq.

55 files changed:
bootstrap.conf
gl/lib/root-dev-ino.h
src/basenc.c
src/cat.c
src/chcon.c
src/chroot.c
src/comm.c
src/copy.c
src/coreutils.c
src/cp.c
src/csplit.c
src/cut.c
src/date.c
src/df.c
src/digest.c
src/dircolors.c
src/du.c
src/echo.c
src/env.c
src/expand-common.c
src/expr.c
src/fmt.c
src/fold.c
src/head.c
src/install.c
src/join.c
src/nl.c
src/numfmt.c
src/od.c
src/paste.c
src/pinky.c
src/pr.c
src/printf.c
src/ptx.c
src/rm.c
src/seq.c
src/set-fields.c
src/shred.c
src/shuf.c
src/sort.c
src/split.c
src/stat.c
src/stdbuf.c
src/stty.c
src/system.h
src/tac.c
src/tail.c
src/test.c
src/touch.c
src/true.c
src/tsort.c
src/uniq.c
src/wc.c
tests/df/no-mtab-status.sh
tests/df/skip-duplicates.sh

index 50e76652dfd3a65f36f0c69b4ce4b30aefca8ef3..1a2d961a1dd5febdebe9bfaa7049b04e1f73c0d2 100644 (file)
@@ -260,6 +260,7 @@ gnulib_modules="
   stpcpy
   str_endswith
   strdup-posix
+  stringeq
   strnlen
   strnumcmp
   strsignal
index 1250d343951501ac771682ef4015c69dd9341ebb..a4d909f8252d60d12546c1fec4384cb4ce39560d 100644 (file)
@@ -33,7 +33,7 @@ get_root_dev_ino (struct dev_ino *root_d_i) _GL_ATTRIBUTE_NONNULL ();
 # define ROOT_DEV_INO_WARN(Dirname)                                    \
   do                                                                   \
     {                                                                  \
-      if (STREQ (Dirname, "/"))                                                \
+      if (streq (Dirname, "/"))                                                \
         error (0, 0, _("it is dangerous to operate recursively on %s"),        \
                quoteaf (Dirname));                                     \
       else                                                             \
index 35168f49b29c47831b78158b883b7f1e492d578c..1fb7a16f589577e17dd19ac05724bd212bdb3787 100644 (file)
@@ -1452,7 +1452,7 @@ finish_and_exit (FILE *in, char const *infile)
 {
   if (fclose (in) != 0)
     {
-      if (STREQ (infile, "-"))
+      if (streq (infile, "-"))
         error (EXIT_FAILURE, errno, _("closing standard input"));
       else
         error (EXIT_FAILURE, errno, "%s", quotef (infile));
@@ -1790,7 +1790,7 @@ main (int argc, char **argv)
   else
     infile = "-";
 
-  if (STREQ (infile, "-"))
+  if (streq (infile, "-"))
     {
       xset_binary_mode (STDIN_FILENO, O_BINARY);
       input_fh = stdin;
index 9b94ee12478d64380d0ba32001a5f54f5bd7d8b2..2a3c1d18a0319527e0a375f8c6dd657ad83a4597 100644 (file)
--- a/src/cat.c
+++ b/src/cat.c
@@ -679,7 +679,7 @@ main (int argc, char **argv)
       if (argind < argc)
         infile = argv[argind];
 
-      bool reading_stdin = STREQ (infile, "-");
+      bool reading_stdin = streq (infile, "-");
       if (reading_stdin)
         {
           have_read_stdin = true;
index 3c8edab31f187953c8f6d8380610c0f1f86286b5..a54133a5cd767e374bd620ab63029b4313428ba2 100644 (file)
@@ -177,7 +177,7 @@ change_file_context (int fd, char const *file)
       context_string = specified_context;
     }
 
-  if (file_context == nullptr || ! STREQ (context_string, file_context))
+  if (file_context == nullptr || ! streq (context_string, file_context))
     {
       int fail = (affect_symlink_referent
                   ?  setfileconat (fd, file, context_string)
index ca0677b0168dc335ce909dae128cb26df3a4ad7c..27cb15e72da505554df57331a8f8dca21e2050c1 100644 (file)
@@ -171,7 +171,7 @@ static bool
 is_root (char const *dir)
 {
   char *resolved = canonicalize_file_name (dir);
-  bool is_res_root = resolved && STREQ ("/", resolved);
+  bool is_res_root = resolved && streq ("/", resolved);
   free (resolved);
   return is_res_root;
 }
index 6ebf66f380d473959ebe3cb3f5dfad55884dc423..355f72b691ce4e14ae95d2ba33dea0c7f9e4a61b 100644 (file)
@@ -285,7 +285,7 @@ compare_files (char **infiles)
       alt[i][0] = 0;
       alt[i][1] = 0;
       alt[i][2] = 0;
-      streams[i] = (STREQ (infiles[i], "-") ? stdin : fopen (infiles[i], "r"));
+      streams[i] = (streq (infiles[i], "-") ? stdin : fopen (infiles[i], "r"));
       if (!streams[i])
         error (EXIT_FAILURE, errno, "%s", quotef (infiles[i]));
 
@@ -464,7 +464,7 @@ main (int argc, char **argv)
         break;
 
       case OUTPUT_DELIMITER_OPTION:
-        if (col_sep_len && !STREQ (col_sep, optarg))
+        if (col_sep_len && !streq (col_sep, optarg))
           error (EXIT_FAILURE, 0, _("multiple output delimiters specified"));
         col_sep = optarg;
         col_sep_len = *optarg ? strlen (optarg) : 1;
index c1df848c8a483eafaa2b11e3580011fc146b769f..11c82e1a81b88b97cefdba7c1dcd6d179239ec1a 100644 (file)
@@ -1598,7 +1598,7 @@ source_is_dst_backup (char const *srcbase, struct stat const *src_st,
   size_t suffixlen = strlen (simple_backup_suffix);
   if (! (srcbaselen == dstbaselen + suffixlen
          && memcmp (srcbase, dstbase, dstbaselen) == 0
-         && STREQ (srcbase + dstbaselen, simple_backup_suffix)))
+         && streq (srcbase + dstbaselen, simple_backup_suffix)))
     return false;
   char *dst_back = subst_suffix (dst_relname,
                                  dst_relname + strlen (dst_relname),
@@ -2435,7 +2435,7 @@ skip:
 
           dst_parent = dir_name (dst_relname);
 
-          in_current_dir = ((dst_dirfd == AT_FDCWD && STREQ (".", dst_parent))
+          in_current_dir = ((dst_dirfd == AT_FDCWD && streq (".", dst_parent))
                             /* If either stat call fails, it's ok not to report
                                the failure and say dst_name is in the current
                                directory.  Other things will fail later.  */
@@ -2555,7 +2555,7 @@ skip:
             areadlinkat_with_size (dst_dirfd, dst_relname, dst_sb.st_size);
           if (dest_link_val)
             {
-              if (STREQ (dest_link_val, src_link_val))
+              if (streq (dest_link_val, src_link_val))
                 symlink_err = 0;
               free (dest_link_val);
             }
index fc79bea2f4bd842d552b536dd6e7edc41f963d0a..5f357cd6877eaee54b40c0456da953b27566c412 100644 (file)
@@ -103,7 +103,7 @@ launch_program (char const *prog_name, int prog_argc, char **prog_argv)
   if (false);
   /* Look up the right main program.  */
 # define SINGLE_BINARY_PROGRAM(prog_name_str, main_name) \
-  else if (STREQ (prog_name_str, prog_name)) \
+  else if (streq (prog_name_str, prog_name)) \
     prog_main = single_binary_main_##main_name;
 # include "coreutils.h"
 # undef SINGLE_BINARY_PROGRAM
@@ -134,7 +134,7 @@ main (int argc, char **argv)
 
   /* Map external name to internal name.  */
   char ginstall[] = "ginstall";
-  if (STREQ (prog_name, "install"))
+  if (streq (prog_name, "install"))
     prog_name = ginstall;
 
   /* If this program is called directly as "coreutils" or if the value of
@@ -198,7 +198,7 @@ main (int argc, char **argv)
 
   /* Only print the error message when no options have been passed
      to coreutils.  */
-  if (optind == 1 && prog_name && !STREQ (prog_name, "coreutils"))
+  if (optind == 1 && prog_name && !streq (prog_name, "coreutils"))
     error (0, 0, _("unknown program %s"),
            quote (prog_name));
 
index 57450dbd45cd2d822aa0faa4dbc6e3d177773a3c..317d667ce0ab57eb3cfbb87a5ee3685c712a2e8f 100644 (file)
--- a/src/cp.c
+++ b/src/cp.c
@@ -742,7 +742,7 @@ do_copy (int n_files, char **file, char const *target_directory,
               ASSIGN_STRDUPA (arg_base, last_component (arg));
               strip_trailing_slashes (arg_base);
               /* For 'cp -R source/.. dest', don't copy into 'dest/..'. */
-              arg_base += STREQ (arg_base, "..");
+              arg_base += streq (arg_base, "..");
               dst_name = file_name_concat (target_directory, arg_base,
                                            &arg_in_concat);
             }
@@ -802,7 +802,7 @@ do_copy (int n_files, char **file, char const *target_directory,
 
       if (x->unlink_dest_after_failed_open
           && x->backup_type != no_backups
-          && STREQ (source, dest)
+          && streq (source, dest)
           && !new_dst
           && (sb.st_mode != 0 || stat (dest, &sb) == 0) && S_ISREG (sb.st_mode))
         {
index 506f9248f95886a03c0c3715fe33b37e3b67bdf3..de499f166a1991abdb16e0cadfe74cbd2d6416c6 100644 (file)
@@ -608,7 +608,7 @@ no_more_lines (void)
 static void
 set_input_file (char const *name)
 {
-  if (! STREQ (name, "-") && fd_reopen (STDIN_FILENO, name, O_RDONLY, 0) < 0)
+  if (! streq (name, "-") && fd_reopen (STDIN_FILENO, name, O_RDONLY, 0) < 0)
     error (EXIT_FAILURE, errno, _("cannot open %s for reading"),
            quoteaf (name));
 }
index b424997035b39bf15c85ca39d273b275e390326f..f0effb9eb5ecfa8986c42d541b74a0f91f7874e9 100644 (file)
--- a/src/cut.c
+++ b/src/cut.c
@@ -441,7 +441,7 @@ cut_file (char const *file, void (*cut_stream) (FILE *))
 {
   FILE *stream;
 
-  if (STREQ (file, "-"))
+  if (streq (file, "-"))
     {
       have_read_stdin = true;
       stream = stdin;
@@ -464,7 +464,7 @@ cut_file (char const *file, void (*cut_stream) (FILE *))
   int err = errno;
   if (!ferror (stream))
     err = 0;
-  if (STREQ (file, "-"))
+  if (streq (file, "-"))
     clearerr (stream);         /* Also clear EOF.  */
   else if (fclose (stream) == EOF)
     err = errno;
index f3a8241cf88f039fcc9272000491337e9eac30bc..db16f3225a8832ab7756cf36317e5ab9fd1b69a6 100644 (file)
@@ -410,7 +410,7 @@ batch_convert (char const *input_filename,
   size_t buflen;
   struct timespec when;
 
-  if (STREQ (input_filename, "-"))
+  if (streq (input_filename, "-"))
     {
       input_filename = _("standard input");
       in_stream = stdin;
index 5e369830fc0a52555aae351a06696433a240a777..857f76cf4ae7c94bf0ed8b80f3ec85ce584cbaa9 100644 (file)
--- a/src/df.c
+++ b/src/df.c
@@ -443,7 +443,7 @@ decode_output_arg (char const *arg)
       display_field_t field = INVALID_FIELD;
       for (idx_t i = 0; i < ARRAY_CARDINALITY (field_data); i++)
         {
-          if (STREQ (field_data[i].arg, s))
+          if (streq (field_data[i].arg, s))
             {
               field = i;
               break;
@@ -643,7 +643,7 @@ selected_fstype (char const *fstype)
   if (fs_select_list == nullptr || fstype == nullptr)
     return true;
   for (fsp = fs_select_list; fsp; fsp = fsp->fs_next)
-    if (STREQ (fstype, fsp->fs_name))
+    if (streq (fstype, fsp->fs_name))
       return true;
   return false;
 }
@@ -659,7 +659,7 @@ excluded_fstype (char const *fstype)
   if (fs_exclude_list == nullptr || fstype == nullptr)
     return false;
   for (fsp = fs_exclude_list; fsp; fsp = fsp->fs_next)
-    if (STREQ (fstype, fsp->fs_name))
+    if (streq (fstype, fsp->fs_name))
       return true;
   return false;
 }
@@ -754,7 +754,7 @@ filter_mount_list (bool devices_only)
                                            < strlen (me->me_mntroot));
               if (! print_grand_total
                   && me->me_remote && seen_dev->me->me_remote
-                  && ! STREQ (seen_dev->me->me_devname, me->me_devname))
+                  && ! streq (seen_dev->me->me_devname, me->me_devname))
                 {
                   /* Don't discard remote entries with different locations,
                      as these are more likely to be explicitly mounted.
@@ -767,12 +767,12 @@ filter_mount_list (bool devices_only)
                        /* let points towards the root of the device win.  */
                        || (target_nearer_root && ! source_below_root)
                        /* let an entry overmounted on a new device win...  */
-                       || (! STREQ (seen_dev->me->me_devname, me->me_devname)
+                       || (! streq (seen_dev->me->me_devname, me->me_devname)
                            /* ... but only when matching an existing mnt point,
                               to avoid problematic replacement when given
                               inaccurate mount lists, seen with some chroot
                               environments for example.  */
-                           && STREQ (me->me_mountdir,
+                           && streq (me->me_mountdir,
                                      seen_dev->me->me_mountdir)))
                 {
                   /* Discard mount entry for existing device.  */
@@ -1057,7 +1057,7 @@ get_dev (char const *device, char const *mount_point, char const *file,
       if (stat (stat_file, &sb) == 0)
         {
           struct mount_entry const * dev_me = me_for_dev (sb.st_dev);
-          if (dev_me && ! STREQ (dev_me->me_devname, device)
+          if (dev_me && ! streq (dev_me->me_devname, device)
               && (! dev_me->me_remote || ! me_remote))
             {
               fstype = "-";
@@ -1244,7 +1244,7 @@ last_device_for_mount (char const *mount)
 
   for (me = mount_list; me; me = me->me_next)
     {
-      if (STREQ (me->me_mountdir, mount))
+      if (streq (me->me_mountdir, mount))
         le = me;
     }
 
@@ -1285,10 +1285,10 @@ get_device (char const *device)
       if (canon_dev && IS_ABSOLUTE_FILE_NAME (canon_dev))
         devname = canon_dev;
 
-      if (STREQ (device, devname))
+      if (streq (device, devname))
         {
           char *last_device = last_device_for_mount (me->me_mountdir);
-          eclipsed_device = last_device && ! STREQ (last_device, devname);
+          eclipsed_device = last_device && ! streq (last_device, devname);
           size_t len = strlen (me->me_mountdir);
 
           if (! eclipsed_device
@@ -1362,7 +1362,7 @@ get_point (char const *point, const struct stat *statp)
 
       for (me = mount_list; me; me = me->me_next)
         {
-          if (!STREQ (me->me_type, "lofs")
+          if (!streq (me->me_type, "lofs")
               && (!best_match || best_match->me_dummy || !me->me_dummy))
             {
               size_t len = strlen (me->me_mountdir);
@@ -1407,7 +1407,7 @@ get_point (char const *point, const struct stat *statp)
           }
 
         if (statp->st_dev == me->me_dev
-            && !STREQ (me->me_type, "lofs")
+            && !streq (me->me_type, "lofs")
             && (!best_match || best_match->me_dummy || !me->me_dummy))
           {
             /* Skip bogus mtab entries.  */
@@ -1734,7 +1734,7 @@ main (int argc, char **argv)
         struct fs_type_list *fs_excl;
         for (fs_excl = fs_exclude_list; fs_excl; fs_excl = fs_excl->fs_next)
           {
-            if (STREQ (fs_incl->fs_name, fs_excl->fs_name))
+            if (streq (fs_incl->fs_name, fs_excl->fs_name))
               {
                 error (0, 0,
                        _("file system type %s both selected and excluded"),
index c9f6106b95609f8f8dce60a4762d7933980122bf..03b3190d6bcf46a7a620b1e52c74d12b35dd670d 100644 (file)
@@ -868,7 +868,7 @@ split_3 (char *s, size_t s_len,
       bool length_specified = s[i] == '-';
       bool openssl_format = s[i] == '('; /* and no length_specified */
       s[i++] = '\0';
-      if (!STREQ (algo_name, DIGEST_TYPE_STRING))
+      if (!streq (algo_name, DIGEST_TYPE_STRING))
         return false;
       if (openssl_format)
         s[--i] = '(';
@@ -1049,7 +1049,7 @@ digest_file (char const *filename, int *binary, unsigned char *bin_result,
 {
   FILE *fp;
   int err;
-  bool is_stdin = STREQ (filename, "-");
+  bool is_stdin = streq (filename, "-");
 
   *missing = false;
 
@@ -1235,7 +1235,7 @@ digest_check (char const *checkfile_name)
   uintmax_t line_number;
   char *line;
   size_t line_chars_allocated;
-  bool is_stdin = STREQ (checkfile_name, "-");
+  bool is_stdin = streq (checkfile_name, "-");
 
   if (is_stdin)
     {
@@ -1289,7 +1289,7 @@ digest_check (char const *checkfile_name)
 
       size_t d_len;
       if (! (split_3 (line, line_length, &digest, &d_len, &binary, &filename)
-             && ! (is_stdin && STREQ (filename, "-"))))
+             && ! (is_stdin && streq (filename, "-"))))
         {
           ++n_misformatted_lines;
 
index 3893f2fb33593012591b47cd5bd9bfaf4f5bf419..cb6714dbfd3eee899edb76bf1919aeae2bebc2a6 100644 (file)
@@ -137,7 +137,7 @@ guess_shell_syntax (void)
 
   shell = last_component (shell);
 
-  if (STREQ (shell, "csh") || STREQ (shell, "tcsh"))
+  if (streq (shell, "csh") || streq (shell, "tcsh"))
     return SHELL_SYNTAX_C;
 
   return SHELL_SYNTAX_BOURNE;
@@ -396,7 +396,7 @@ dc_parse_file (char const *filename)
 {
   bool ok;
 
-  if (! STREQ (filename, "-") && freopen (filename, "r", stdin) == nullptr)
+  if (! streq (filename, "-") && freopen (filename, "r", stdin) == nullptr)
     {
       error (0, errno, "%s", quotef (filename));
       return false;
index e8ad3e93c0d300ea5e7865133e45c6c676a7ef93..f4dbd8c0535a1de833b4adc4f31bc4adc2ba099e 100644 (file)
--- a/src/du.c
+++ b/src/du.c
@@ -950,7 +950,7 @@ main (int argc, char **argv)
           time_style = getenv ("TIME_STYLE");
 
           /* Ignore TIMESTYLE="locale", for compatibility with ls.  */
-          if (! time_style || STREQ (time_style, "locale"))
+          if (! time_style || streq (time_style, "locale"))
             time_style = "long-iso";
           else if (*time_style == '+')
             {
@@ -1007,7 +1007,7 @@ main (int argc, char **argv)
           usage (EXIT_FAILURE);
         }
 
-      if (! (STREQ (files_from, "-") || freopen (files_from, "r", stdin)))
+      if (! (streq (files_from, "-") || freopen (files_from, "r", stdin)))
         error (EXIT_FAILURE, errno, _("cannot open %s for reading"),
                quoteaf (files_from));
 
@@ -1066,7 +1066,7 @@ main (int argc, char **argv)
               affirm (!"unexpected error code from argv_iter");
             }
         }
-      if (files_from && STREQ (files_from, "-") && STREQ (file_name, "-"))
+      if (files_from && streq (files_from, "-") && streq (file_name, "-"))
         {
           /* Give a better diagnostic in an unusual case:
              printf - | du --files0-from=- */
index 991a57425312588d30ea19c66844b52969e93c3e..c688037b3723cb08591c9b6666a00831bda879e2 100644 (file)
@@ -116,7 +116,7 @@ main (int argc, char **argv)
   bool posixly_correct = !!getenv ("POSIXLY_CORRECT");
   bool allow_options =
     (! posixly_correct
-     || (! DEFAULT_ECHO_TO_XPG && 1 < argc && STREQ (argv[1], "-n")));
+     || (! DEFAULT_ECHO_TO_XPG && 1 < argc && streq (argv[1], "-n")));
 
   /* System V machines already have a /bin/sh with a v9 behavior.
      Use the identical behavior for these machines so that the
@@ -135,10 +135,10 @@ main (int argc, char **argv)
      order to avoid accepting abbreviations.  */
   if (allow_options && argc == 2)
     {
-      if (STREQ (argv[1], "--help"))
+      if (streq (argv[1], "--help"))
         usage (EXIT_SUCCESS);
 
-      if (STREQ (argv[1], "--version"))
+      if (streq (argv[1], "--version"))
         {
           version_etc (stdout, PROGRAM_NAME, PACKAGE_NAME, Version, AUTHORS,
                        (char *) nullptr);
index baa1e1372d52dbad0529e4a5182538cf196d15b3..e06ca55681bf7ba99a1a837a402cf82d0770967b 100644 (file)
--- a/src/env.c
+++ b/src/env.c
@@ -831,7 +831,7 @@ main (int argc, char **argv)
         }
     }
 
-  if (optind < argc && STREQ (argv[optind], "-"))
+  if (optind < argc && streq (argv[optind], "-"))
     {
       ignore_environment = true;
       ++optind;
index 366c589cf65422b02b950253875f83e390ad1a7f..ca2ad4d67b60e6401fce5bcf4b186a57e9a3f8b6 100644 (file)
@@ -348,7 +348,7 @@ next_file (FILE *fp)
       int err = errno;
       if (!ferror (fp))
         err = 0;
-      if (STREQ (prev_file, "-"))
+      if (streq (prev_file, "-"))
         clearerr (fp);         /* Also clear EOF.  */
       else if (fclose (fp) != 0)
         err = errno;
@@ -361,7 +361,7 @@ next_file (FILE *fp)
 
   while ((file = *file_list++) != nullptr)
     {
-      if (STREQ (file, "-"))
+      if (streq (file, "-"))
         {
           have_read_stdin = true;
           fp = stdin;
index cd87763df7269a99e274a29fe4cde66ff52b4952..17a1ddd299f2260a5bc0a2f60d904e298f8b1a2a 100644 (file)
@@ -322,7 +322,7 @@ main (int argc, char **argv)
 
   /* The above handles --help and --version.
      Since there is no other invocation of getopt, handle '--' here.  */
-  if (1 < argc && STREQ (argv[1], "--"))
+  if (1 < argc && streq (argv[1], "--"))
     {
       --argc;
       ++argv;
@@ -522,7 +522,7 @@ nextarg (char const *str)
     return false;
   else
     {
-      bool r = STREQ (*args, str);
+      bool r = streq (*args, str);
       args += r;
       return r;
     }
index 408fe45a1ade8755f115e451093e83c8623de9f2..b44bbde5c7cf2c76de529f395248ab22c55c75eb 100644 (file)
--- a/src/fmt.c
+++ b/src/fmt.c
@@ -424,7 +424,7 @@ main (int argc, char **argv)
       for (; optind < argc; optind++)
         {
           char *file = argv[optind];
-          if (STREQ (file, "-"))
+          if (streq (file, "-"))
             {
               ok &= fmt (stdin, file);
               have_read_stdin = true;
index 6969a81e80f1fccd6adc919589ba85e83c38d1f2..e9083714327f54d65a038ad271f4789eac05a19f 100644 (file)
@@ -157,7 +157,7 @@ fold_file (char const *filename, size_t width)
   static size_t length_in = 0;
   int saved_errno;
 
-  if (STREQ (filename, "-"))
+  if (streq (filename, "-"))
     {
       istream = stdin;
       have_read_stdin = true;
@@ -291,7 +291,7 @@ fold_file (char const *filename, size_t width)
   if (offset_out)
     write_out (line_out, offset_out, /*newline=*/ false);
 
-  if (STREQ (filename, "-"))
+  if (streq (filename, "-"))
     clearerr (istream);
   else if (fclose (istream) != 0 && !saved_errno)
     saved_errno = errno;
index 20c2ee031364b3de841b9b817e7646dbda9a53c7..127099dfc5e1298d1893727d69d61526fe7385a6 100644 (file)
@@ -860,7 +860,7 @@ head_file (char const *filename, uintmax_t n_units, bool count_lines,
 {
   int fd;
   bool ok;
-  bool is_stdin = STREQ (filename, "-");
+  bool is_stdin = streq (filename, "-");
 
   if (is_stdin)
     {
index b3b26abdb40dfdc2c71a0bfd9243341003dd775a..53f6a2ff57499778d7f4cf3079f0bfb1bf9aa2b4 100644 (file)
@@ -227,7 +227,7 @@ need_copy (char const *src_name, char const *dest_name,
           return true;
         }
 
-      scontext_match = STREQ (file_scontext_raw, to_scontext_raw);
+      scontext_match = streq (file_scontext_raw, to_scontext_raw);
 
       freecon (file_scontext_raw);
       freecon (to_scontext_raw);
index faf402eeab50fb87cb63e6079b9ddbdd83d4db7c..28d9dd3ee3bd4842f0575024036044f55c65f600 100644 (file)
@@ -1054,7 +1054,7 @@ main (int argc, char **argv)
           break;
 
         case 'e':
-          if (empty_filler && ! STREQ (empty_filler, optarg))
+          if (empty_filler && ! streq (empty_filler, optarg))
             error (EXIT_FAILURE, 0,
                    _("conflicting empty-field replacement strings"));
           empty_filler = optarg;
@@ -1089,7 +1089,7 @@ main (int argc, char **argv)
           break;
 
         case 'o':
-          if (STREQ (optarg, "auto"))
+          if (streq (optarg, "auto"))
             autoformat = true;
           else
             {
@@ -1107,7 +1107,7 @@ main (int argc, char **argv)
                 newtab = mcel_ch ('\n', 1);
                 /* output_separator does not matter.  */
               }
-            else if (STREQ (optarg, "\\0"))
+            else if (streq (optarg, "\\0"))
               {
                 newtab = mcel_ch ('\0', 1);
                 output_separator = "";
@@ -1188,10 +1188,10 @@ main (int argc, char **argv)
   if (join_field_2 < 0)
     join_field_2 = 0;
 
-  fp1 = STREQ (g_names[0], "-") ? stdin : fopen (g_names[0], "r");
+  fp1 = streq (g_names[0], "-") ? stdin : fopen (g_names[0], "r");
   if (!fp1)
     error (EXIT_FAILURE, errno, "%s", quotef (g_names[0]));
-  fp2 = STREQ (g_names[1], "-") ? stdin : fopen (g_names[1], "r");
+  fp2 = streq (g_names[1], "-") ? stdin : fopen (g_names[1], "r");
   if (!fp2)
     error (EXIT_FAILURE, errno, "%s", quotef (g_names[1]));
   if (fp1 == fp2)
index 71421c4baba24fae3f2a1e67c3e22af19039bd79..2812b383b7882ebf190379a1f8fdd7ca079b1680 100644 (file)
--- a/src/nl.c
+++ b/src/nl.c
@@ -436,7 +436,7 @@ nl_file (char const *file)
 {
   FILE *stream;
 
-  if (STREQ (file, "-"))
+  if (streq (file, "-"))
     {
       have_read_stdin = true;
       stream = stdin;
@@ -459,7 +459,7 @@ nl_file (char const *file)
   int err = errno;
   if (!ferror (stream))
     err = 0;
-  if (STREQ (file, "-"))
+  if (streq (file, "-"))
     clearerr (stream);         /* Also clear EOF. */
   else if (fclose (stream) != 0 && !err)
     err = errno;
@@ -544,11 +544,11 @@ main (int argc, char **argv)
                                      0, XTOINT_MIN_RANGE);
           break;
         case 'n':
-          if (STREQ (optarg, "ln"))
+          if (streq (optarg, "ln"))
             lineno_format = FORMAT_LEFT;
-          else if (STREQ (optarg, "rn"))
+          else if (streq (optarg, "rn"))
             lineno_format = FORMAT_RIGHT_NOLZ;
-          else if (STREQ (optarg, "rz"))
+          else if (streq (optarg, "rz"))
             lineno_format = FORMAT_RIGHT_LZ;
           else
             {
index 3fc027c7ea4dc15af1cb973a2a6ffa9d0ebe0800..4f72facb94447f0e24a4abbd9826d4a6be012c86 100644 (file)
@@ -1279,7 +1279,7 @@ process_suffixed_number (char *text, long double *result,
     {
       char *possible_suffix = text + strlen (text) - strlen (suffix);
 
-      if (STREQ (suffix, possible_suffix))
+      if (streq (suffix, possible_suffix))
         {
           /* trim suffix, ONLY if it's at the end of the text.  */
           *possible_suffix = '\0';
index d38a4c38035a2de58aad7b72505d4d9d34b3665a..45d9f32e6ff13790af22c025f5caea3d9ab0fe4e 100644 (file)
--- a/src/od.c
+++ b/src/od.c
@@ -987,7 +987,7 @@ open_next_file (void)
         return ok;
       ++file_list;
 
-      if (STREQ (input_filename, "-"))
+      if (streq (input_filename, "-"))
         {
           input_filename = _("standard input");
           in_stream = stdin;
@@ -1028,7 +1028,7 @@ check_and_close (int in_errno)
     {
       if (!ferror (in_stream))
         in_errno = 0;
-      if (STREQ (file_list[-1], "-"))
+      if (streq (file_list[-1], "-"))
         clearerr (in_stream);
       else if (fclose (in_stream) != 0 && !in_errno)
         in_errno = errno;
index 10d142436676151dcd71612972da2e1af24c285e..d2c5c2d425b68bfb25a61ccb4f77bf38e8b699ff 100644 (file)
@@ -191,7 +191,7 @@ paste_parallel (size_t nfiles, char **fnamptr)
 
   for (files_open = 0; files_open < nfiles; ++files_open)
     {
-      if (STREQ (fnamptr[files_open], "-"))
+      if (streq (fnamptr[files_open], "-"))
         {
           have_read_stdin = true;
           fileptr[files_open] = stdin;
@@ -343,7 +343,7 @@ paste_serial (size_t nfiles, char **fnamptr)
   for (; nfiles; nfiles--, fnamptr++)
     {
       int saved_errno;
-      bool is_stdin = STREQ (*fnamptr, "-");
+      bool is_stdin = streq (*fnamptr, "-");
       if (is_stdin)
         {
           have_read_stdin = true;
index 287b3a3f2bb3333c31cf64541898230c13eca483..b49096b35710819ec5a2dc9a389a8530eb56bbc1 100644 (file)
@@ -452,7 +452,7 @@ scan_entries (idx_t n, STRUCT_UTMP const *utmp_buf,
           if (argc_names)
             {
               for (int i = 0; i < argc_names; i++)
-                if (STREQ (utmp_buf->ut_user, argv_names[i]))
+                if (streq (utmp_buf->ut_user, argv_names[i]))
                   {
                     print_entry (utmp_buf);
                     break;
index e7081a059abbfcfc768dd3dbfb2d8676bdb23877..87974d058b7bad25bbf156c300ca2068e3997de1 100644 (file)
--- a/src/pr.c
+++ b/src/pr.c
@@ -1483,7 +1483,7 @@ init_funcs (void)
 static bool
 open_file (char *name, COLUMN *p)
 {
-  if (STREQ (name, "-"))
+  if (streq (name, "-"))
     {
       p->name = _("standard input");
       p->fp = stdin;
@@ -1654,7 +1654,7 @@ init_header (char const *filename, int desc)
   struct tm tm;
 
   /* If parallel files or standard input, use current date. */
-  if (STREQ (filename, "-"))
+  if (streq (filename, "-"))
     desc = -1;
   if (0 <= desc && fstat (desc, &st) == 0)
     t = get_stat_mtime (&st);
index 2a73bb7fed892347eafb40f497ce5080f511fc9b..5ac9e13eeaa66f06e1b05b97815a900852fddacd 100644 (file)
@@ -708,10 +708,10 @@ main (int argc, char **argv)
      order to avoid accepting abbreviations.  */
   if (argc == 2)
     {
-      if (STREQ (argv[1], "--help"))
+      if (streq (argv[1], "--help"))
         usage (EXIT_SUCCESS);
 
-      if (STREQ (argv[1], "--version"))
+      if (streq (argv[1], "--version"))
         {
           version_etc (stdout, PROGRAM_NAME, PACKAGE_NAME, Version, AUTHORS,
                        (char *) nullptr);
@@ -721,7 +721,7 @@ main (int argc, char **argv)
 
   /* The above handles --help and --version.
      Since there is no other invocation of getopt, handle '--' here.  */
-  if (1 < argc && STREQ (argv[1], "--"))
+  if (1 < argc && streq (argv[1], "--"))
     {
       --argc;
       ++argv;
index 006eb66afec29cbba3fe6d28729d13dc66b04dc2..1f7fc6731c5ce07fd5108cae7aa440bca8f5dbdf 100644 (file)
--- a/src/ptx.c
+++ b/src/ptx.c
@@ -505,7 +505,7 @@ swallow_file_in_memory (char const *file_name, BLOCK *block)
   /* As special cases, a file name which is null or "-" indicates standard
      input, which is already opened.  In all other cases, open the file from
      its name.  */
-  bool using_stdin = !file_name || !*file_name || STREQ (file_name, "-");
+  bool using_stdin = !file_name || !*file_name || streq (file_name, "-");
   if (using_stdin)
     block->start = fread_file (stdin, 0, &used_length);
   else
@@ -1915,7 +1915,7 @@ main (int argc, char **argv)
 
       for (file_index = 0; file_index < number_input_files; file_index++)
         {
-          if (!*argv[optind] || STREQ (argv[optind], "-"))
+          if (!*argv[optind] || streq (argv[optind], "-"))
             input_file_name[file_index] = nullptr;
           else
             input_file_name[file_index] = argv[optind];
@@ -1931,7 +1931,7 @@ main (int argc, char **argv)
       input_file_name = xmalloc (sizeof *input_file_name);
       file_line_count = xmalloc (sizeof *file_line_count);
       text_buffers    = xmalloc (sizeof *text_buffers);
-      if (!*argv[optind] || STREQ (argv[optind], "-"))
+      if (!*argv[optind] || streq (argv[optind], "-"))
         input_file_name[0] = nullptr;
       else
         input_file_name[0] = argv[optind];
index 46a3d4d1358662fe3ced8325c03ecbbd48ef9747..2d08e71d9f3836e723d3b7eb1cc549bf66b19ca4 100644 (file)
--- a/src/rm.c
+++ b/src/rm.c
@@ -295,7 +295,7 @@ main (int argc, char **argv)
           break;
 
         case NO_PRESERVE_ROOT:
-          if (! STREQ (argv[optind - 1], "--no-preserve-root"))
+          if (! streq (argv[optind - 1], "--no-preserve-root"))
             error (EXIT_FAILURE, 0,
                    _("you may not abbreviate the --no-preserve-root option"));
           preserve_root = false;
@@ -304,7 +304,7 @@ main (int argc, char **argv)
         case PRESERVE_ROOT:
           if (optarg)
             {
-              if STREQ (optarg, "all")
+              if (streq (optarg, "all"))
                 x.preserve_all_root = true;
               else
                 error (EXIT_FAILURE, 0,
index 59de4979842db3f71fda5557cc02592fded0f5f5..2bff0d40cc6b2eacbb16c8098a758eb2fdd5c0e1 100644 (file)
--- a/src/seq.c
+++ b/src/seq.c
@@ -347,7 +347,7 @@ print_numbers (char const *fmt, struct layout layout,
                   if (x0_strlen < 0)
                     xalloc_die ();
                   x0_str[x0_strlen - layout.suffix_len] = '\0';
-                  print_extra_number = !STREQ (x0_str, x_str);
+                  print_extra_number = !streq (x0_str, x_str);
                   free (x0_str);
                 }
 
index 31547e4e9a0cf071d6bcbf89f8cb92036ef8a35d..14f7e4d650beb4e0c1c0ce479228495fd8af8ccf 100644 (file)
@@ -147,7 +147,7 @@ set_fields (char const *fieldstr, unsigned int options)
   /* Collect and store in RP the range end points. */
 
   /* Special case: '--field=-' means all fields, emulate '--field=1-' . */
-  if ((options & SETFLD_ALLOW_DASH) && STREQ (fieldstr,"-"))
+  if ((options & SETFLD_ALLOW_DASH) && streq (fieldstr,"-"))
     {
       value = 1;
       lhs_specified = true;
index 64582289499f16effa3d7c163943b9328ec7a9d6..cf782f16eb262d6f077fcce99d5f62702a4f52b7 100644 (file)
@@ -552,7 +552,7 @@ dopass (int fd, struct stat const *st, char const *qname, off_t *sizep,
             = human_readable (offset, offset_buf,
                               human_floor | human_progress_opts, 1, 1);
 
-          if (done || !STREQ (previous_human_offset, human_offset))
+          if (done || !streq (previous_human_offset, human_offset))
             {
               if (! known (size))
                 error (0, 0, _("%s: pass %lu/%lu (%s)...%s"),
@@ -1195,7 +1195,7 @@ main (int argc, char **argv)
           break;
 
         case RANDOM_SOURCE_OPTION:
-          if (random_source && !STREQ (random_source, optarg))
+          if (random_source && !streq (random_source, optarg))
             error (EXIT_FAILURE, 0, _("multiple random sources specified"));
           random_source = optarg;
           break;
@@ -1252,7 +1252,7 @@ main (int argc, char **argv)
   for (i = 0; i < n_files; i++)
     {
       char *qname = xstrdup (quotef (file[i]));
-      if (STREQ (file[i], "-"))
+      if (streq (file[i], "-"))
         {
           ok &= wipefd (STDOUT_FILENO, qname, randint_source, &flags);
         }
index 3c50aa23dd30ee7092984609413cb52a0bc88b83..d43606620fc1a30d47880a4231626dc0584a92e6 100644 (file)
@@ -450,13 +450,13 @@ main (int argc, char **argv)
         break;
 
       case 'o':
-        if (outfile && !STREQ (outfile, optarg))
+        if (outfile && !streq (outfile, optarg))
           error (EXIT_FAILURE, 0, _("multiple output files specified"));
         outfile = optarg;
         break;
 
       case RANDOM_SOURCE_OPTION:
-        if (random_source && !STREQ (random_source, optarg))
+        if (random_source && !streq (random_source, optarg))
           error (EXIT_FAILURE, 0, _("multiple random sources specified"));
         random_source = optarg;
         break;
@@ -511,7 +511,7 @@ main (int argc, char **argv)
     {
       /* If an input file is specified, re-open it as stdin.  */
       if (n_operands == 1
-          && ! (STREQ (operand[0], "-")
+          && ! (streq (operand[0], "-")
                 || freopen (operand[0], "r", stdin)))
         error (EXIT_FAILURE, errno, "%s", quotef (operand[0]));
 
index a4d81bc1c822ba2c8c1e9a85eeedab8f40f61eb7..5a6a963f358b6e14cd3ad218c3b1ce021b4c9d93 100644 (file)
@@ -954,7 +954,7 @@ stream_open (char const *file, char const *how)
 
   if (*how == 'r')
     {
-      if (STREQ (file, "-"))
+      if (streq (file, "-"))
         {
           have_read_stdin = true;
           fp = stdin;
@@ -1534,7 +1534,7 @@ sort_buffer_size (FILE *const *fps, size_t nfps,
       size_t worst_case;
 
       if ((i < nfps ? fstat (fileno (fps[i]), &st)
-           : STREQ (files[i], "-") ? fstat (STDIN_FILENO, &st)
+           : streq (files[i], "-") ? fstat (STDIN_FILENO, &st)
            : stat (files[i], &st))
           != 0)
         sort_die (_("stat failed"), files[i]);
@@ -3859,11 +3859,11 @@ avoid_trashing_input (struct sortfile *files, size_t ntemps,
 
   for (size_t i = ntemps; i < nfiles; i++)
     {
-      bool is_stdin = STREQ (files[i].name, "-");
+      bool is_stdin = streq (files[i].name, "-");
       bool same;
       struct stat instat;
 
-      if (outfile && STREQ (outfile, files[i].name) && !is_stdin)
+      if (outfile && streq (outfile, files[i].name) && !is_stdin)
         same = true;
       else
         {
@@ -3907,7 +3907,7 @@ check_inputs (char *const *files, size_t nfiles)
 {
   for (size_t i = 0; i < nfiles; i++)
     {
-      if (STREQ (files[i], "-"))
+      if (streq (files[i], "-"))
         continue;
 
       if (euidaccess (files[i], R_OK) != 0)
@@ -4567,7 +4567,7 @@ main (int argc, char **argv)
           break;
 
         case COMPRESS_PROGRAM_OPTION:
-          if (compress_program && !STREQ (compress_program, optarg))
+          if (compress_program && !streq (compress_program, optarg))
             error (SORT_FAILURE, 0, _("multiple compress programs specified"));
           compress_program = optarg;
           break;
@@ -4640,13 +4640,13 @@ main (int argc, char **argv)
           break;
 
         case 'o':
-          if (outfile && !STREQ (outfile, optarg))
+          if (outfile && !streq (outfile, optarg))
             error (SORT_FAILURE, 0, _("multiple output files specified"));
           outfile = optarg;
           break;
 
         case RANDOM_SOURCE_OPTION:
-          if (random_source && !STREQ (random_source, optarg))
+          if (random_source && !streq (random_source, optarg))
             error (SORT_FAILURE, 0, _("multiple random sources specified"));
           random_source = optarg;
           break;
@@ -4666,7 +4666,7 @@ main (int argc, char **argv)
               error (SORT_FAILURE, 0, _("empty tab"));
             if (optarg[1])
               {
-                if (STREQ (optarg, "\\0"))
+                if (streq (optarg, "\\0"))
                   newtab = '\0';
                 else
                   {
@@ -4757,7 +4757,7 @@ main (int argc, char **argv)
           nfiles = tok.n_tok;
           for (size_t i = 0; i < nfiles; i++)
             {
-              if (STREQ (files[i], "-"))
+              if (streq (files[i], "-"))
                 error (SORT_FAILURE, 0, _("when reading file names from "
                                           "standard input, "
                                           "no file name of %s allowed"),
index e5f6947f817ee5d94db2877b5e4974af2b9f1754..e58e0db54ea1e070d1b307c1f8c10dd5c2e13383 100644 (file)
@@ -1452,7 +1452,7 @@ main (int argc, char **argv)
               error (EXIT_FAILURE, 0, _("empty record separator"));
             if (optarg[1])
               {
-                if (STREQ (optarg, "\\0"))
+                if (streq (optarg, "\\0"))
                   neweol = '\0';
                 else
                   {
@@ -1605,7 +1605,7 @@ main (int argc, char **argv)
     }
 
   /* Open the input file.  */
-  if (! STREQ (infile, "-")
+  if (! streq (infile, "-")
       && fd_reopen (STDIN_FILENO, infile, O_RDONLY, 0) < 0)
     error (EXIT_FAILURE, errno, _("cannot open %s for reading"),
            quoteaf (infile));
index df9e3d440819c7fedb69e6528c5e7b00bfceabba..348e33793d601aa255232583bbe25be7de3addf3 100644 (file)
@@ -967,7 +967,7 @@ find_bind_mount (char const * name)
   for (me = mount_list; me; me = me->me_next)
     {
       if (me->me_dummy && me->me_devname[0] == '/'
-          && STREQ (me->me_mountdir, name))
+          && streq (me->me_mountdir, name))
         {
           struct stat dev_stats;
 
@@ -1260,7 +1260,7 @@ do_statfs (char const *filename, char const *format)
 {
   STRUCT_STATVFS statfsbuf;
 
-  if (STREQ (filename, "-"))
+  if (streq (filename, "-"))
     {
       error (0, 0, _("using %s to denote standard input does not work"
                      " in file system mode"), quoteaf (filename));
@@ -1367,7 +1367,7 @@ NODISCARD
 static bool
 do_stat (char const *filename, char const *format, char const *format2)
 {
-  int fd = STREQ (filename, "-") ? 0 : AT_FDCWD;
+  int fd = streq (filename, "-") ? 0 : AT_FDCWD;
   int flags = 0;
   struct stat st;
   struct statx stx = {0};
@@ -1456,7 +1456,7 @@ static bool
 do_stat (char const *filename, char const *format,
          char const *format2)
 {
-  int fd = STREQ (filename, "-") ? 0 : -1;
+  int fd = streq (filename, "-") ? 0 : -1;
   struct stat statbuf;
   struct print_args pa;
   pa.st = &statbuf;
index b61ddf6a46a0cb87da1fe0278ce9ffe405812192..11b9a12f27c5c07b52baeb348a4ad68ddde1c378 100644 (file)
@@ -347,7 +347,7 @@ main (int argc, char **argv)
               usage (EXIT_CANCELED);
             }
 
-          if (!STREQ (optarg, "L")
+          if (!streq (optarg, "L")
               && parse_size (optarg, &stdbuf[opt_fileno].size) == -1)
             error (EXIT_CANCELED, errno, _("invalid mode %s"), quote (optarg));
 
index 3b2469a9b2dd5a08976f2899b761b5b49a46044f..8032304bb42e3b117fa0980c91f256e3e5d28482 100644 (file)
@@ -1128,14 +1128,14 @@ apply_settings (bool checking, char const *device_name,
           ++arg;
           reversed = true;
         }
-      if (STREQ (arg, "drain"))
+      if (streq (arg, "drain"))
         {
           tcsetattr_options = reversed ? TCSANOW : TCSADRAIN;
           continue;
         }
       for (i = 0; mode_info[i].name != nullptr; ++i)
         {
-          if (STREQ (arg, mode_info[i].name))
+          if (streq (arg, mode_info[i].name))
             {
               if ((mode_info[i].flags & NO_SETATTR) == 0)
                 {
@@ -1156,7 +1156,7 @@ apply_settings (bool checking, char const *device_name,
         {
           for (i = 0; control_info[i].name != nullptr; ++i)
             {
-              if (STREQ (arg, control_info[i].name))
+              if (streq (arg, control_info[i].name))
                 {
                   check_argument (arg);
                   match_found = true;
@@ -1169,7 +1169,7 @@ apply_settings (bool checking, char const *device_name,
         }
       if (!match_found || not_set_attr)
         {
-          if (STREQ (arg, "ispeed"))
+          if (streq (arg, "ispeed"))
             {
               check_argument (arg);
               ++k;
@@ -1183,7 +1183,7 @@ apply_settings (bool checking, char const *device_name,
                 continue;
               *require_set_attr = true;
             }
-          else if (STREQ (arg, "ospeed"))
+          else if (streq (arg, "ospeed"))
             {
               check_argument (arg);
               ++k;
@@ -1200,7 +1200,7 @@ apply_settings (bool checking, char const *device_name,
 #ifdef TIOCEXT
           /* This is the BSD interface to "extproc".
             Even though it's an lflag, an ioctl is used to set it.  */
-          else if (STREQ (arg, "extproc"))
+          else if (streq (arg, "extproc"))
             {
               int val = ! reversed;
 
@@ -1213,7 +1213,7 @@ apply_settings (bool checking, char const *device_name,
             }
 #endif
 #ifdef TIOCGWINSZ
-          else if (STREQ (arg, "rows"))
+          else if (streq (arg, "rows"))
             {
               check_argument (arg);
               ++k;
@@ -1222,8 +1222,8 @@ apply_settings (bool checking, char const *device_name,
               set_window_size (integer_arg (settings[k], INT_MAX), -1,
                                device_name);
             }
-          else if (STREQ (arg, "cols")
-                   || STREQ (arg, "columns"))
+          else if (streq (arg, "cols")
+                   || streq (arg, "columns"))
             {
               check_argument (arg);
               ++k;
@@ -1232,7 +1232,7 @@ apply_settings (bool checking, char const *device_name,
               set_window_size (-1, integer_arg (settings[k], INT_MAX),
                                device_name);
             }
-          else if (STREQ (arg, "size"))
+          else if (streq (arg, "size"))
             {
               if (checking)
                 continue;
@@ -1242,7 +1242,7 @@ apply_settings (bool checking, char const *device_name,
             }
 #endif
 #ifdef HAVE_C_LINE
-          else if (STREQ (arg, "line"))
+          else if (streq (arg, "line"))
             {
               check_argument (arg);
               ++k;
@@ -1253,7 +1253,7 @@ apply_settings (bool checking, char const *device_name,
               *require_set_attr = true;
             }
 #endif
-          else if (STREQ (arg, "speed"))
+          else if (streq (arg, "speed"))
             {
               if (checking)
                 continue;
@@ -1356,8 +1356,8 @@ main (int argc, char **argv)
         default:
           /* Consider "drain" as an option rather than a setting,
              to support: alias stty='stty -drain'  etc.  */
-          if (! STREQ (argv[argi + opti], "-drain")
-              && ! STREQ (argv[argi + opti], "drain"))
+          if (! streq (argv[argi + opti], "-drain")
+              && ! streq (argv[argi + opti], "drain"))
             noargs = false;
 
           /* Skip the argument containing this unrecognized option;
@@ -1497,21 +1497,21 @@ set_mode (struct mode_info const *info, bool reversed, struct termios *mode)
   if (bitsp == nullptr)
     {
       /* Combination mode. */
-      if (STREQ (info->name, "evenp") || STREQ (info->name, "parity"))
+      if (streq (info->name, "evenp") || streq (info->name, "parity"))
         {
           if (reversed)
             mode->c_cflag = (mode->c_cflag & ~PARENB & ~CSIZE) | CS8;
           else
             mode->c_cflag = (mode->c_cflag & ~PARODD & ~CSIZE) | PARENB | CS7;
         }
-      else if (STREQ (info->name, "oddp"))
+      else if (streq (info->name, "oddp"))
         {
           if (reversed)
             mode->c_cflag = (mode->c_cflag & ~PARENB & ~CSIZE) | CS8;
           else
             mode->c_cflag = (mode->c_cflag & ~CSIZE) | CS7 | PARODD | PARENB;
         }
-      else if (STREQ (info->name, "nl"))
+      else if (streq (info->name, "nl"))
         {
           if (reversed)
             {
@@ -1537,21 +1537,21 @@ set_mode (struct mode_info const *info, bool reversed, struct termios *mode)
 #endif
             }
         }
-      else if (STREQ (info->name, "ek"))
+      else if (streq (info->name, "ek"))
         {
           mode->c_cc[VERASE] = CERASE;
           mode->c_cc[VKILL] = CKILL;
         }
-      else if (STREQ (info->name, "sane"))
+      else if (streq (info->name, "sane"))
         sane_mode (mode);
-      else if (STREQ (info->name, "cbreak"))
+      else if (streq (info->name, "cbreak"))
         {
           if (reversed)
             mode->c_lflag |= ICANON;
           else
             mode->c_lflag &= ~ICANON;
         }
-      else if (STREQ (info->name, "pass8"))
+      else if (streq (info->name, "pass8"))
         {
           if (reversed)
             {
@@ -1564,7 +1564,7 @@ set_mode (struct mode_info const *info, bool reversed, struct termios *mode)
               mode->c_iflag &= ~ISTRIP;
             }
         }
-      else if (STREQ (info->name, "litout"))
+      else if (streq (info->name, "litout"))
         {
           if (reversed)
             {
@@ -1579,7 +1579,7 @@ set_mode (struct mode_info const *info, bool reversed, struct termios *mode)
               mode->c_oflag &= ~OPOST;
             }
         }
-      else if (STREQ (info->name, "raw") || STREQ (info->name, "cooked"))
+      else if (streq (info->name, "raw") || streq (info->name, "cooked"))
         {
           if ((info->name[0] == 'r' && reversed)
               || (info->name[0] == 'c' && !reversed))
@@ -1610,7 +1610,7 @@ set_mode (struct mode_info const *info, bool reversed, struct termios *mode)
             }
         }
 #ifdef IXANY
-      else if (STREQ (info->name, "decctlq"))
+      else if (streq (info->name, "decctlq"))
         {
           if (reversed)
             mode->c_iflag |= IXANY;
@@ -1619,7 +1619,7 @@ set_mode (struct mode_info const *info, bool reversed, struct termios *mode)
         }
 #endif
 #ifdef TABDLY
-      else if (STREQ (info->name, "tabs"))
+      else if (streq (info->name, "tabs"))
         {
           if (reversed)
             mode->c_oflag = (mode->c_oflag & ~TABDLY) | TAB3;
@@ -1628,7 +1628,7 @@ set_mode (struct mode_info const *info, bool reversed, struct termios *mode)
         }
 #else
 # ifdef OXTABS
-      else if (STREQ (info->name, "tabs"))
+      else if (streq (info->name, "tabs"))
         {
           if (reversed)
             mode->c_oflag = mode->c_oflag | OXTABS;
@@ -1638,8 +1638,8 @@ set_mode (struct mode_info const *info, bool reversed, struct termios *mode)
 # endif
 #endif
 #if defined XCASE && defined IUCLC && defined OLCUC
-      else if (STREQ (info->name, "lcase")
-               || STREQ (info->name, "LCASE"))
+      else if (streq (info->name, "lcase")
+               || streq (info->name, "LCASE"))
         {
           if (reversed)
             {
@@ -1655,7 +1655,7 @@ set_mode (struct mode_info const *info, bool reversed, struct termios *mode)
             }
         }
 #endif
-      else if (STREQ (info->name, "crt"))
+      else if (streq (info->name, "crt"))
         mode->c_lflag |= ECHOE
 #ifdef ECHOCTL
           | ECHOCTL
@@ -1664,7 +1664,7 @@ set_mode (struct mode_info const *info, bool reversed, struct termios *mode)
           | ECHOKE
 #endif
           ;
-      else if (STREQ (info->name, "dec"))
+      else if (streq (info->name, "dec"))
         {
           mode->c_cc[VINTR] = 3;       /* ^C */
           mode->c_cc[VERASE] = 127;    /* DEL */
@@ -1696,11 +1696,11 @@ set_control_char (struct control_info const *info, char const *arg,
 {
   unsigned long int value;
 
-  if (STREQ (info->name, "min") || STREQ (info->name, "time"))
+  if (streq (info->name, "min") || streq (info->name, "time"))
     value = integer_arg (arg, TYPE_MAXIMUM (cc_t));
   else if (arg[0] == '\0' || arg[1] == '\0')
     value = to_uchar (arg[0]);
-  else if (STREQ (arg, "^-") || STREQ (arg, "undef"))
+  else if (streq (arg, "^-") || streq (arg, "undef"))
     value = _POSIX_VDISABLE;
   else if (arg[0] == '^' && arg[1] != '\0')    /* Ignore any trailing junk. */
     {
@@ -1924,26 +1924,26 @@ display_changed (struct termios *mode)
   current_col = 0;
 
   empty_line = true;
-  for (i = 0; !STREQ (control_info[i].name, "min"); ++i)
+  for (i = 0; !streq (control_info[i].name, "min"); ++i)
     {
       if (mode->c_cc[control_info[i].offset] == control_info[i].saneval)
         continue;
 
 #ifdef VFLUSHO
       /* 'flush' is the deprecated equivalent of 'discard'.  */
-      if (STREQ (control_info[i].name, "flush"))
+      if (streq (control_info[i].name, "flush"))
         continue;
 #endif
       /* If swtch is the same as susp, don't print both.  */
 #if VSWTCH == VSUSP
-      if (STREQ (control_info[i].name, "swtch"))
+      if (streq (control_info[i].name, "swtch"))
         continue;
 #endif
       /* If eof uses the same slot as min, only print whichever applies.  */
 #if VEOF == VMIN
       if ((mode->c_lflag & ICANON) == 0
-          && (STREQ (control_info[i].name, "eof")
-              || STREQ (control_info[i].name, "eol")))
+          && (streq (control_info[i].name, "eof")
+              || streq (control_info[i].name, "eol")))
         continue;
 #endif
 
@@ -2016,23 +2016,23 @@ display_all (struct termios *mode, char const *device_name)
   putchar ('\n');
   current_col = 0;
 
-  for (i = 0; ! STREQ (control_info[i].name, "min"); ++i)
+  for (i = 0; ! streq (control_info[i].name, "min"); ++i)
     {
 #ifdef VFLUSHO
       /* 'flush' is the deprecated equivalent of 'discard'.  */
-      if (STREQ (control_info[i].name, "flush"))
+      if (streq (control_info[i].name, "flush"))
         continue;
 #endif
       /* If swtch is the same as susp, don't print both.  */
 #if VSWTCH == VSUSP
-      if (STREQ (control_info[i].name, "swtch"))
+      if (streq (control_info[i].name, "swtch"))
         continue;
 #endif
       /* If eof uses the same slot as min, only print whichever applies.  */
 #if VEOF == VMIN
       if ((mode->c_lflag & ICANON) == 0
-          && (STREQ (control_info[i].name, "eof")
-              || STREQ (control_info[i].name, "eol")))
+          && (streq (control_info[i].name, "eof")
+              || streq (control_info[i].name, "eol")))
         continue;
 #endif
       wrapf ("%s = %s;", control_info[i].name,
@@ -2223,9 +2223,9 @@ string_to_baud (char const *arg)
   else if (c)
     {
       /* Not a valid number; check for legacy aliases "exta" and "extb" */
-      if (STREQ (arg, "exta"))
+      if (streq (arg, "exta"))
         return B19200;
-      else if (STREQ (arg, "extb"))
+      else if (streq (arg, "extb"))
         return B38400;
       else
         return (speed_t) -1;
@@ -2243,7 +2243,7 @@ sane_mode (struct termios *mode)
   for (i = 0; control_info[i].name; ++i)
     {
 #if VMIN == VEOF
-      if (STREQ (control_info[i].name, "min"))
+      if (streq (control_info[i].name, "min"))
         break;
 #endif
       mode->c_cc[control_info[i].offset] = control_info[i].saneval;
index 2296c8bbb9396b65802fca4534e2b3934b3002a7..f37d4b811a23a260afd4916a2f617c4aa355635a 100644 (file)
@@ -183,7 +183,6 @@ select_plural (uintmax_t n)
   return (n <= ULONG_MAX ? n : n % PLURAL_REDUCER + PLURAL_REDUCER);
 }
 
-#define STREQ(a, b) (strcmp (a, b) == 0)
 #define STREQ_LEN(a, b, n) (strncmp (a, b, n) == 0) /* n==-1 means unbounded */
 #define STRPREFIX(a, b) (strncmp (a, b, strlen (b)) == 0)
 
@@ -652,7 +651,7 @@ emit_ancillary_info (char const *program)
   char const *node = program;
   struct infomap const *map_prog = infomap;
 
-  while (map_prog->program && ! STREQ (program, map_prog->program))
+  while (map_prog->program && ! streq (program, map_prog->program))
     map_prog++;
 
   if (map_prog->node)
@@ -675,7 +674,7 @@ emit_ancillary_info (char const *program)
   /* .htaccess on the coreutils web site maps programs to the appropriate page,
      however we explicitly handle "[" -> "test" here as the "[" is not
      recognized as part of a URL by default in terminals.  */
-  char const *url_program = STREQ (program, "[") ? "test" : program;
+  char const *url_program = streq (program, "[") ? "test" : program;
   printf (_("Full documentation <%s%s>\n"),
           PACKAGE_URL, url_program);
   printf (_("or available locally via: info '(coreutils) %s%s'\n"),
index 2779c2d2cdd1b9cc81c05183a70deba3ad796433..e049331592049590b39642304122a27c9677bdc7 100644 (file)
--- a/src/tac.c
+++ b/src/tac.c
@@ -442,7 +442,7 @@ tac_file (char const *filename)
   bool ok;
   off_t file_size;
   int fd;
-  bool is_stdin = STREQ (filename, "-");
+  bool is_stdin = streq (filename, "-");
 
   if (is_stdin)
     {
index 753963937755dcf29c42c85b330aed6940bf0d73..b8bef1d91cdb6cde2b666b6c1575376e075eaeb8 100644 (file)
@@ -967,7 +967,7 @@ recheck (struct File_spec *f, bool blocking)
 {
   struct stat new_stats;
   bool ok = false;
-  bool is_stdin = (STREQ (f->name, "-"));
+  bool is_stdin = (streq (f->name, "-"));
   int prev_errnum = f->errnum;
   bool new_file;
   int fd = (is_stdin
@@ -1377,7 +1377,7 @@ static bool
 tailable_stdin (const struct File_spec *f, int n_files)
 {
   for (int i = 0; i < n_files; i++)
-    if (!f[i].ignore && STREQ (f[i].name, "-"))
+    if (!f[i].ignore && streq (f[i].name, "-"))
       return true;
   return false;
 }
@@ -1705,7 +1705,7 @@ tail_forever_inotify (int wd, struct File_spec *f, int n_files,
               /* With N=hundreds of frequently-changing files, this O(N^2)
                  process might be a problem.  FIXME: use a hash table?  */
               if (f[j].parent_wd == ev->wd
-                  && STREQ (ev->name, f[j].name + f[j].basename_start))
+                  && streq (ev->name, f[j].name + f[j].basename_start))
                 break;
             }
 
@@ -1966,7 +1966,7 @@ tail_file (struct File_spec *f, count_t n_files, count_t n_units)
   /* Avoid blocking if we may need to process asynchronously.  */
   bool nonblocking = forever && (nbpids || n_files > 1);
 
-  bool is_stdin = (STREQ (f->name, "-"));
+  bool is_stdin = (streq (f->name, "-"));
 
   if (is_stdin)
     {
@@ -2073,7 +2073,7 @@ parse_obsolete_option (int argc, char * const *argv, count_t *n_units)
      one file argument.  Watch out for "-" and "--", though.  */
   if (! (argc == 2
          || (argc == 3 && ! (argv[2][0] == '-' && argv[2][1]))
-         || (3 <= argc && argc <= 4 && STREQ (argv[2], "--"))))
+         || (3 <= argc && argc <= 4 && streq (argv[2], "--"))))
     return false;
 
   int posix_ver = posix2_version ();
@@ -2287,7 +2287,7 @@ ignore_fifo_and_pipe (struct File_spec *f, int n_files)
   for (int i = 0; i < n_files; i++)
     {
       bool is_a_fifo_or_pipe =
-        (STREQ (f[i].name, "-")
+        (streq (f[i].name, "-")
          && !f[i].ignore
          && 0 <= f[i].fd
          && (S_ISFIFO (f[i].mode)
@@ -2369,7 +2369,7 @@ main (int argc, char **argv)
     bool found_hyphen = false;
 
     for (int i = 0; i < n_files; i++)
-      if (STREQ (file[i], "-"))
+      if (streq (file[i], "-"))
         found_hyphen = true;
 
     /* When following by name, there must be a name.  */
@@ -2404,7 +2404,7 @@ main (int argc, char **argv)
   for (int i = 0; i < n_files; i++)
     {
       F[i].name = file[i];
-      F[i].prettyname = STREQ (file[i], "-") ? _("standard input") : file[i];
+      F[i].prettyname = streq (file[i], "-") ? _("standard input") : file[i];
     }
 
   if (header_mode == always
index 61bf8b741274093fb420316f9906f31cab9dc6ea..c11542922f60281042d09e6d94f81082bb9348d5 100644 (file)
@@ -186,20 +186,20 @@ get_mtime (char const *filename)
 static int
 binop (char const *s)
 {
-  return (  STREQ (s, "="  ) ? EQ_STRING_BINOP
-          : STREQ (s, "==" ) ? EQ_STRING_BINOP /* an alias for = */
-          : STREQ (s, "!=" ) ? NE_STRING_BINOP
-          : STREQ (s, ">"  ) ? GT_STRING_BINOP
-          : STREQ (s, "<"  ) ? LT_STRING_BINOP
-          : STREQ (s, "-eq") ? EQ_BINOP
-          : STREQ (s, "-ne") ? NE_BINOP
-          : STREQ (s, "-lt") ? LT_BINOP
-          : STREQ (s, "-le") ? LE_BINOP
-          : STREQ (s, "-gt") ? GT_BINOP
-          : STREQ (s, "-ge") ? GE_BINOP
-          : STREQ (s, "-ot") ? OT_BINOP
-          : STREQ (s, "-nt") ? NT_BINOP
-          : STREQ (s, "-ef") ? EF_BINOP
+  return (  streq (s, "="  ) ? EQ_STRING_BINOP
+          : streq (s, "==" ) ? EQ_STRING_BINOP /* an alias for = */
+          : streq (s, "!=" ) ? NE_STRING_BINOP
+          : streq (s, ">"  ) ? GT_STRING_BINOP
+          : streq (s, "<"  ) ? LT_STRING_BINOP
+          : streq (s, "-eq") ? EQ_BINOP
+          : streq (s, "-ne") ? NE_BINOP
+          : streq (s, "-lt") ? LT_BINOP
+          : streq (s, "-le") ? LE_BINOP
+          : streq (s, "-gt") ? GT_BINOP
+          : streq (s, "-ge") ? GE_BINOP
+          : streq (s, "-ot") ? OT_BINOP
+          : streq (s, "-nt") ? NT_BINOP
+          : streq (s, "-ef") ? EF_BINOP
           : -1);
 }
 
@@ -246,7 +246,7 @@ term (void)
       advance (true);
 
       for (nargs = 1;
-           pos + nargs < argc && ! STREQ (argv[pos + nargs], ")");
+           pos + nargs < argc && ! streq (argv[pos + nargs], ")");
            nargs++)
         if (nargs == 4)
           {
@@ -265,7 +265,7 @@ term (void)
     }
 
   /* Are there enough arguments left that this could be dyadic?  */
-  else if (4 <= argc - pos && STREQ (argv[pos], "-l")
+  else if (4 <= argc - pos && streq (argv[pos], "-l")
            && 0 <= (bop = binop (argv[pos + 2])))
     value = binary_operator (true, bop);
   else if (3 <= argc - pos
@@ -294,7 +294,7 @@ binary_operator (bool l_is_l, enum binop bop)
   op = pos + 1;
 
   /* Is the right integer expression of the form '-l string'? */
-  bool r_is_l = op < argc - 2 && STREQ (argv[op + 1], "-l");
+  bool r_is_l = op < argc - 2 && streq (argv[op + 1], "-l");
   if (r_is_l)
     advance (false);
 
@@ -349,7 +349,7 @@ binary_operator (bool l_is_l, enum binop bop)
 
     case EQ_STRING_BINOP:
     case NE_STRING_BINOP:
-      return STREQ (argv[op - 1], argv[op + 1]) == (bop == EQ_STRING_BINOP);
+      return streq (argv[op - 1], argv[op + 1]) == (bop == EQ_STRING_BINOP);
 
     case GT_STRING_BINOP:
     case LT_STRING_BINOP:
@@ -519,7 +519,7 @@ and (void)
   while (true)
     {
       value &= term ();
-      if (! (pos < argc && STREQ (argv[pos], "-a")))
+      if (! (pos < argc && streq (argv[pos], "-a")))
         return value;
       advance (false);
     }
@@ -538,7 +538,7 @@ or (void)
   while (true)
     {
       value |= and ();
-      if (! (pos < argc && STREQ (argv[pos], "-o")))
+      if (! (pos < argc && streq (argv[pos], "-o")))
         return value;
       advance (false);
     }
@@ -568,7 +568,7 @@ two_arguments (void)
 {
   bool value;
 
-  if (STREQ (argv[pos], "!"))
+  if (streq (argv[pos], "!"))
     {
       advance (false);
       value = ! one_argument ();
@@ -592,19 +592,19 @@ three_arguments (void)
 
   if (0 <= bop)
     value = binary_operator (false, bop);
-  else if (STREQ (argv[pos], "!"))
+  else if (streq (argv[pos], "!"))
     {
       advance (true);
       value = !two_arguments ();
     }
-  else if (STREQ (argv[pos], "(") && STREQ (argv[pos + 2], ")"))
+  else if (streq (argv[pos], "(") && streq (argv[pos + 2], ")"))
     {
       advance (false);
       value = one_argument ();
       advance (false);
     }
-  else if (STREQ (argv[pos + 1], "-a") || STREQ (argv[pos + 1], "-o")
-           || STREQ (argv[pos + 1], ">") || STREQ (argv[pos + 1], "<"))
+  else if (streq (argv[pos + 1], "-a") || streq (argv[pos + 1], "-o")
+           || streq (argv[pos + 1], ">") || streq (argv[pos + 1], "<"))
     value = expr ();
   else
     test_syntax_error (_("%s: binary operator expected"),
@@ -633,13 +633,13 @@ posixtest (int nargs)
         break;
 
       case 4:
-        if (STREQ (argv[pos], "!"))
+        if (streq (argv[pos], "!"))
           {
             advance (true);
             value = !three_arguments ();
             break;
           }
-        if (STREQ (argv[pos], "(") && STREQ (argv[pos + 3], ")"))
+        if (streq (argv[pos], "(") && streq (argv[pos + 3], ")"))
           {
             advance (false);
             value = two_arguments ();
@@ -815,17 +815,17 @@ main (int margc, char **margv)
          and "test --version" to exit silently with status 0.  */
       if (margc == 2)
         {
-          if (STREQ (margv[1], "--help"))
+          if (streq (margv[1], "--help"))
             usage (EXIT_SUCCESS);
 
-          if (STREQ (margv[1], "--version"))
+          if (streq (margv[1], "--version"))
             {
               version_etc (stdout, PROGRAM_NAME, PACKAGE_NAME, Version, AUTHORS,
                            (char *) nullptr);
               test_main_return (EXIT_SUCCESS);
             }
         }
-      if (margc < 2 || !STREQ (margv[margc - 1], "]"))
+      if (margc < 2 || !streq (margv[margc - 1], "]"))
         test_syntax_error (_("missing %s"), quote ("]"));
 
       --margc;
index 2b54808b7c7602ecfb2d42f2b864d6bdc65305d3..bc6b23840e70f1130356358709246793f5295c60 100644 (file)
@@ -124,7 +124,7 @@ touch (char const *file)
   int open_errno = 0;
   struct timespec const *t = newtime;
 
-  if (STREQ (file, "-"))
+  if (streq (file, "-"))
     fd = STDOUT_FILENO;
   else if (! (no_create || no_dereference))
     {
index 3ce0005fa425e89dde80e237f0ad7a1da473a0e2..34406b66d14728d11a83594f3da025ddb93fd62a 100644 (file)
@@ -68,10 +68,10 @@ main (int argc, char **argv)
          edge case where writes fail with GNU specific options.  */
       atexit (close_stdout);
 
-      if (STREQ (argv[1], "--help"))
+      if (streq (argv[1], "--help"))
         usage (EXIT_STATUS);
 
-      if (STREQ (argv[1], "--version"))
+      if (streq (argv[1], "--version"))
         version_etc (stdout, PROGRAM_NAME, PACKAGE_NAME, Version, AUTHORS,
                      (char *) nullptr);
     }
index dcbfdc24fd61456956accca6b5c58da2e9beac16..7aff3e29aa73e6f5553772fc2012454019e3e95a 100644 (file)
@@ -265,7 +265,7 @@ record_relation (struct item *j, struct item *k)
 {
   struct successor *p;
 
-  if (!STREQ (j->str, k->str))
+  if (!streq (j->str, k->str))
     {
       k->count++;
       p = xmalloc (sizeof *p);
@@ -432,7 +432,7 @@ tsort (char const *file)
   struct item *j = nullptr;
   struct item *k = nullptr;
   token_buffer tokenbuffer;
-  bool is_stdin = STREQ (file, "-");
+  bool is_stdin = streq (file, "-");
 
   /* Initialize the head of the tree holding the strings we're sorting.  */
   struct item *root = new_item (nullptr);
index 9aa780574beb74b9da32b23428ba560a59ccfd40..bce1949f3155bb99205cc1fd708d5e069908d705 100644 (file)
@@ -322,9 +322,9 @@ check_file (char const *infile, char const *outfile, char delimiter)
   struct linebuffer lb1, lb2;
   struct linebuffer *thisline, *prevline;
 
-  if (! (STREQ (infile, "-") || freopen (infile, "r", stdin)))
+  if (! (streq (infile, "-") || freopen (infile, "r", stdin)))
     error (EXIT_FAILURE, errno, "%s", quotef (infile));
-  if (! (STREQ (outfile, "-") || freopen (outfile, "w", stdout)))
+  if (! (streq (outfile, "-") || freopen (outfile, "w", stdout)))
     error (EXIT_FAILURE, errno, "%s", quotef (outfile));
 
   fadvise (stdin, FADVISE_SEQUENTIAL);
index 5f974e1c0f009febc160d5da269d47ebb0caa547..777277f23de386dc47ecb88060ea6a502489fe67 100644 (file)
--- a/src/wc.c
+++ b/src/wc.c
@@ -623,7 +623,7 @@ wc (int fd, char const *file_x, struct fstatus *fstatus)
 static bool
 wc_file (char const *file, struct fstatus *fstatus)
 {
-  if (! file || STREQ (file, "-"))
+  if (! file || streq (file, "-"))
     {
       have_read_stdin = true;
       xset_binary_mode (STDIN_FILENO, O_BINARY);
@@ -670,7 +670,7 @@ get_input_fstatus (idx_t nfiles, char *const *file)
   else
     {
       for (idx_t i = 0; i < nfiles; i++)
-        fstatus[i].failed = (! file[i] || STREQ (file[i], "-")
+        fstatus[i].failed = (! file[i] || streq (file[i], "-")
                              ? fstat (STDIN_FILENO, &fstatus[i].st)
                              : stat (file[i], &fstatus[i].st));
     }
@@ -815,7 +815,7 @@ main (int argc, char **argv)
           usage (EXIT_FAILURE);
         }
 
-      if (STREQ (files_from, "-"))
+      if (streq (files_from, "-"))
         stream = stdin;
       else
         {
@@ -871,7 +871,7 @@ main (int argc, char **argv)
   for (int i = 0; (file_name = argv_iter (ai, &ai_err)); i++)
     {
       bool skip_file = false;
-      if (files_from && STREQ (files_from, "-") && STREQ (file_name, "-"))
+      if (files_from && streq (files_from, "-") && streq (file_name, "-"))
         {
           /* Give a better diagnostic in an unusual case:
              printf - | wc --files0-from=- */
index 47105a13aef9d4625c84d15b2f4bbfea591b0d93..0c2e8982d5d5d24d6311329a087a5693c1d93802 100755 (executable)
@@ -39,8 +39,6 @@ cat > k.c <<EOF || framework_failure_
 #include <stdarg.h>
 #include <dlfcn.h>
 
-#define STREQ(a, b) (strcmp (a, b) == 0)
-
 int open(const char *path, int flags, ...)
 {
   static int (*open_func)(const char *, int, ...);
@@ -67,7 +65,7 @@ int open(const char *path, int flags, ...)
 
   /* Returning ENOENT here will get read_file_system_list()
      to fall back to using getmntent() below.  */
-  if (STREQ (path, "/proc/self/mountinfo"))
+  if (streq (path, "/proc/self/mountinfo"))
     {
       errno = ENOENT;
       return -1;
index 644f2e027ef563b062466f56bd3f94e5324dbe07..f97f794f54588a7d9043f67e67dce54102ef533f 100755 (executable)
@@ -49,8 +49,6 @@ cat > k.c <<EOF || framework_failure_
 #include <stdarg.h>
 #include <dlfcn.h>
 
-#define STREQ(a, b) (strcmp (a, b) == 0)
-
 int open(const char *path, int flags, ...)
 {
   static int (*open_func)(const char *, int, ...);
@@ -77,7 +75,7 @@ int open(const char *path, int flags, ...)
 
   /* Returning ENOENT here will get read_file_system_list()
      to fall back to using getmntent() below.  */
-  if (STREQ (path, "/proc/self/mountinfo"))
+  if (streq (path, "/proc/self/mountinfo"))
     {
       errno = ENOENT;
       return -1;
@@ -86,8 +84,6 @@ int open(const char *path, int flags, ...)
     return open_func(path, flags, mode);
 }
 
-#define STREQ(a, b) (strcmp (a, b) == 0)
-
 struct mntent *getmntent (FILE *fp)
 {
   static char *nonroot_fs;
@@ -132,9 +128,9 @@ struct mntent *getmntent (FILE *fp)
         mntents[done-2].mnt_type = "-";
       if (!mntents[done-2].mnt_opts)
         mntents[done-2].mnt_opts = "-";
-      if (STREQ (mntents[done-2].mnt_dir, "/NONROOT"))
+      if (streq (mntents[done-2].mnt_dir, "/NONROOT"))
         mntents[done-2].mnt_dir = nonroot_fs;
-      if (STREQ (mntents[done-2].mnt_dir, "/REMOTE"))
+      if (streq (mntents[done-2].mnt_dir, "/REMOTE"))
         {
           if (!remote_fs || !*remote_fs)
             continue;