]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
stringeq: prefer streq to strcmp in other modules
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 17 Sep 2025 06:08:01 +0000 (23:08 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 17 Sep 2025 15:20:25 +0000 (08:20 -0700)
* lib/acl-internal.c, lib/argmatch.c, lib/argp-help.c:
* lib/argp-parse.c, lib/bcp47.c, lib/c32_get_mapping.c:
* lib/c32_get_type_test.c, lib/concat-filename.c:
* lib/cpu-supports.h, lib/dfa.c, lib/duplocale.c, lib/exclude.c:
* lib/findprog-in.c, lib/findprog.c, lib/fopen.c, lib/freopen.c:
* lib/fts.c, lib/gen-uni-tables.c, lib/getfilecon.c:
* lib/getlogin.c, lib/getugroups.c, lib/hard-locale.c:
* lib/hashcode-named-file.c, lib/hashkey-string.c:
* lib/iconv_open.c, lib/idcache.c, lib/lc-charset-unicode.c:
* lib/localcharset.c, lib/localename-environ.c:
* lib/localename-unsafe.c, lib/mbs_endswith.c, lib/mountlist.c:
* lib/newlocale.c, lib/nl_langinfo.c, lib/nproc.c, lib/open.c:
* lib/os2-spawn.c, lib/parse-datetime.y, lib/popen.c:
* lib/progreloc.c, lib/propername.c, lib/pt_chown.c, lib/putenv.c:
* lib/qcopy-acl.c, lib/readutmp.c, lib/rpmatch.c:
* lib/setlocale-fixes.c, lib/setlocale.c, lib/sig2str.c:
* lib/spawni.c, lib/stat.c, lib/str_endswith.c, lib/streq.h:
* lib/striconveha.c, lib/struniq.h, lib/supersede.c:
* lib/time_rz.c, lib/unicodeio.c, lib/vasnprintf.c:
* lib/vc-mtime.c, lib/wctrans-impl.h, lib/wctype-impl.h:
Prefer streq to strcmp when either will do.
Do not make this change to files shared with glibc.
Do not make the change to test files, at least not for now.
* lib/gen-uni-tables.c (streq): New static function, in same style.
* modules/acl-permissions, modules/argp, modules/c32_get_mapping:
* modules/c32_get_type_test, modules/concat-filename:
* modules/cpu-supports, modules/dfa, modules/duplocale:
* modules/exclude, modules/findprog, modules/findprog-in:
* modules/fopen, modules/fopen-gnu, modules/freopen, modules/fts:
* modules/getlocalename_l-simple, modules/getlocalename_l-unsafe:
* modules/getlogin, modules/getugroups, modules/hard-locale:
* modules/hashcode-named-file, modules/hashkey-string:
* modules/iconv_open, modules/idcache, modules/localcharset:
* modules/localename, modules/localename-unsafe:
* modules/mbs_endswith, modules/mountlist, modules/newlocale:
* modules/nl_langinfo, modules/nproc, modules/open:
* modules/parse-datetime, modules/popen:
* modules/posix_spawn-internal, modules/propername:
* modules/pt_chown, modules/putenv-gnu, modules/qcopy-acl:
* modules/rpmatch, modules/selinux-h, modules/setenv:
* modules/setlocale, modules/setlocale-fixes, modules/sig2str:
* modules/spawn-pipe, modules/stat, modules/str_endswith:
* modules/streq, modules/striconveha, modules/supersede:
* modules/time_rz, modules/uchar-h, modules/unicodeio:
* modules/uniconv/base, modules/wctrans, modules/wctype:
(Depends-on): Add stringeq.

121 files changed:
ChangeLog
lib/acl-internal.c
lib/argmatch.c
lib/argp-help.c
lib/argp-parse.c
lib/bcp47.c
lib/c32_get_mapping.c
lib/c32_get_type_test.c
lib/concat-filename.c
lib/cpu-supports.h
lib/dfa.c
lib/duplocale.c
lib/exclude.c
lib/findprog-in.c
lib/findprog.c
lib/fopen.c
lib/freopen.c
lib/fts.c
lib/gen-uni-tables.c
lib/getfilecon.c
lib/getlogin.c
lib/getugroups.c
lib/hard-locale.c
lib/hashcode-named-file.c
lib/hashkey-string.c
lib/iconv_open.c
lib/idcache.c
lib/lc-charset-unicode.c
lib/localcharset.c
lib/localename-environ.c
lib/localename-unsafe.c
lib/mbs_endswith.c
lib/mountlist.c
lib/newlocale.c
lib/nl_langinfo.c
lib/nproc.c
lib/open.c
lib/os2-spawn.c
lib/parse-datetime.y
lib/popen.c
lib/progreloc.c
lib/propername.c
lib/pt_chown.c
lib/putenv.c
lib/qcopy-acl.c
lib/readutmp.c
lib/rpmatch.c
lib/setlocale-fixes.c
lib/setlocale.c
lib/sig2str.c
lib/spawni.c
lib/stat.c
lib/str_endswith.c
lib/streq.h
lib/striconveha.c
lib/struniq.h
lib/supersede.c
lib/time_rz.c
lib/unicodeio.c
lib/vasnprintf.c
lib/vc-mtime.c
lib/wctrans-impl.h
lib/wctype-impl.h
modules/acl-permissions
modules/argp
modules/c32_get_mapping
modules/c32_get_type_test
modules/concat-filename
modules/cpu-supports
modules/dfa
modules/duplocale
modules/exclude
modules/findprog
modules/findprog-in
modules/fopen
modules/fopen-gnu
modules/freopen
modules/fts
modules/getlocalename_l-simple
modules/getlocalename_l-unsafe
modules/getlogin
modules/getugroups
modules/hard-locale
modules/hashcode-named-file
modules/hashkey-string
modules/iconv_open
modules/idcache
modules/localcharset
modules/localename
modules/localename-unsafe
modules/mbs_endswith
modules/mountlist
modules/newlocale
modules/nl_langinfo
modules/nproc
modules/open
modules/parse-datetime
modules/popen
modules/posix_spawn-internal
modules/propername
modules/pt_chown
modules/putenv-gnu
modules/qcopy-acl
modules/rpmatch
modules/selinux-h
modules/setenv
modules/setlocale
modules/setlocale-fixes
modules/sig2str
modules/spawn-pipe
modules/stat
modules/str_endswith
modules/streq
modules/striconveha
modules/supersede
modules/time_rz
modules/uchar-h
modules/unicodeio
modules/uniconv/base
modules/wctrans
modules/wctype

index e99039ed819b07b9e231ff057216e3ace05a5eea..d0ed07e64f8b85d56932e2bee6645b91d6aa2830 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,53 @@
 2025-09-17  Paul Eggert  <eggert@cs.ucla.edu>
 
+       stringeq: prefer streq to strcmp in other modules
+       * lib/acl-internal.c, lib/argmatch.c, lib/argp-help.c:
+       * lib/argp-parse.c, lib/bcp47.c, lib/c32_get_mapping.c:
+       * lib/c32_get_type_test.c, lib/concat-filename.c:
+       * lib/cpu-supports.h, lib/dfa.c, lib/duplocale.c, lib/exclude.c:
+       * lib/findprog-in.c, lib/findprog.c, lib/fopen.c, lib/freopen.c:
+       * lib/fts.c, lib/gen-uni-tables.c, lib/getfilecon.c:
+       * lib/getlogin.c, lib/getugroups.c, lib/hard-locale.c:
+       * lib/hashcode-named-file.c, lib/hashkey-string.c:
+       * lib/iconv_open.c, lib/idcache.c, lib/lc-charset-unicode.c:
+       * lib/localcharset.c, lib/localename-environ.c:
+       * lib/localename-unsafe.c, lib/mbs_endswith.c, lib/mountlist.c:
+       * lib/newlocale.c, lib/nl_langinfo.c, lib/nproc.c, lib/open.c:
+       * lib/os2-spawn.c, lib/parse-datetime.y, lib/popen.c:
+       * lib/progreloc.c, lib/propername.c, lib/pt_chown.c, lib/putenv.c:
+       * lib/qcopy-acl.c, lib/readutmp.c, lib/rpmatch.c:
+       * lib/setlocale-fixes.c, lib/setlocale.c, lib/sig2str.c:
+       * lib/spawni.c, lib/stat.c, lib/str_endswith.c, lib/streq.h:
+       * lib/striconveha.c, lib/struniq.h, lib/supersede.c:
+       * lib/time_rz.c, lib/unicodeio.c, lib/vasnprintf.c:
+       * lib/vc-mtime.c, lib/wctrans-impl.h, lib/wctype-impl.h:
+       Prefer streq to strcmp when either will do.
+       Do not make this change to files shared with glibc.
+       Do not make the change to test files, at least not for now.
+       * lib/gen-uni-tables.c (streq): New static function, in same style.
+       * modules/acl-permissions, modules/argp, modules/c32_get_mapping:
+       * modules/c32_get_type_test, modules/concat-filename:
+       * modules/cpu-supports, modules/dfa, modules/duplocale:
+       * modules/exclude, modules/findprog, modules/findprog-in:
+       * modules/fopen, modules/fopen-gnu, modules/freopen, modules/fts:
+       * modules/getlocalename_l-simple, modules/getlocalename_l-unsafe:
+       * modules/getlogin, modules/getugroups, modules/hard-locale:
+       * modules/hashcode-named-file, modules/hashkey-string:
+       * modules/iconv_open, modules/idcache, modules/localcharset:
+       * modules/localename, modules/localename-unsafe:
+       * modules/mbs_endswith, modules/mountlist, modules/newlocale:
+       * modules/nl_langinfo, modules/nproc, modules/open:
+       * modules/parse-datetime, modules/popen:
+       * modules/posix_spawn-internal, modules/propername:
+       * modules/pt_chown, modules/putenv-gnu, modules/qcopy-acl:
+       * modules/rpmatch, modules/selinux-h, modules/setenv:
+       * modules/setlocale, modules/setlocale-fixes, modules/sig2str:
+       * modules/spawn-pipe, modules/stat, modules/str_endswith:
+       * modules/streq, modules/striconveha, modules/supersede:
+       * modules/time_rz, modules/uchar-h, modules/unicodeio:
+       * modules/uniconv/base, modules/wctrans, modules/wctype:
+       (Depends-on): Add stringeq.
+
        stringeq: prefer memeq to memcmp in other modules
        * lib/argmatch.c, lib/argmatch.h, lib/backupfile.c, lib/bcp47.c:
        * lib/boot-time.c, lib/csharpcomp.c, lib/csharpexec.c:
index 11bd15c4327c2a5a05cdfb630a9458796447dbd4..b8a6ed06c319062b4101d49780de03f6e561b7ff 100644 (file)
@@ -118,9 +118,9 @@ acl_access_nontrivial (acl_t acl)
                        - S-1-5-32-545 (group "Users")
                        Cf. <https://learn.microsoft.com/en-us/windows/win32/secauthz/well-known-sids>
                        and look at the output of the 'mkgroup' command.  */
-                    ignorable = (strcmp (group_sid, "S-1-5-18") == 0
-                                 || strcmp (group_sid, "S-1-5-32-544") == 0
-                                 || strcmp (group_sid, "S-1-5-32-545") == 0);
+                    ignorable = (streq (group_sid, "S-1-5-18")
+                                 || streq (group_sid, "S-1-5-32-544")
+                                 || streq (group_sid, "S-1-5-32-545"));
                   }
               }
             if (!ignorable)
index 4dcea99ccb1e7f144436b7f133eaac02f37f166e..a1efc6fa22739fdf4c40391316129efd632fa422 100644 (file)
@@ -126,7 +126,7 @@ argmatch_exact (const char *arg, const char *const *arglist)
   /* Test elements for exact match.  */
   for (i = 0; arglist[i]; i++)
     {
-      if (!strcmp (arglist[i], arg))
+      if (streq (arglist[i], arg))
         return i;
     }
 
index fc6fcf456baea2e2c1a2be6e275928b477a51eba..f742e1870f79dca3ce887e54b2ad2e0f3840b805 100644 (file)
@@ -654,7 +654,7 @@ hol_find_entry (struct hol *hol, const char *name)
           unsigned num_opts = entry->num;
 
           while (num_opts-- > 0)
-            if (opt->name && ovisible (opt) && strcmp (opt->name, name) == 0)
+            if (opt->name && ovisible (opt) && streq (opt->name, name))
               return entry;
             else
               opt++;
index 34ffd4f574d95b65b7412dca6587d46e3db1df95..265dafa2d580e21cbf2aec7ec08b311bfce92d4d 100644 (file)
@@ -177,7 +177,7 @@ find_long_option (struct option *long_options, const char *name)
 {
   struct option *l = long_options;
   while (l->name != NULL)
-    if (name != NULL && strcmp (l->name, name) == 0)
+    if (name != NULL && streq (l->name, name))
       return l - long_options;
     else
       l++;
@@ -814,8 +814,7 @@ parser_parse_next (struct parser *parser, int *arg_ebadkey)
         {
           parser->try_getopt = 0;
           if (parser->state.next > 1
-              && strcmp (parser->state.argv[parser->state.next - 1], QUOTE)
-                   == 0)
+              && streq (parser->state.argv[parser->state.next - 1], QUOTE))
             /* Not only is this the end of the options, but it's a
                "quoted" region, which may have args that *look* like
                options, so we definitely shouldn't try to use getopt past
index 33a078c8a28f99f6ff93f5ac0ec6de9771082661..dc7e06e28bb0bcd1dc530347a1314f5d30f29c20 100644 (file)
@@ -192,14 +192,14 @@ void
 xpg_to_bcp47 (char *bcp47, const char *xpg)
 {
   /* Special cases.  */
-  if (strcmp (xpg, "") == 0)
+  if (streq (xpg, ""))
    fail:
     {
       strcpy (bcp47, "und");
       return;
     }
   if ((xpg[0] == 'C' && (xpg[1] == '\0' || xpg[1] == '.'))
-      || strcmp (xpg, "POSIX") == 0)
+      || streq (xpg, "POSIX"))
     {
       /* The "C" (or "C.UTF-8") and "POSIX" locales most closely resemble the
          "en_US" locale.  */
@@ -367,7 +367,7 @@ void
 bcp47_to_xpg (char *xpg, const char *bcp47, const char *codeset)
 {
   /* Special cases.  */
-  if (strcmp (bcp47, "") == 0)
+  if (streq (bcp47, ""))
    fail:
     {
       strcpy (xpg, "");
@@ -514,7 +514,7 @@ bcp47_to_xpg (char *xpg, const char *bcp47, const char *codeset)
             default_script_in_territory (xpg, territory);
           if (sp != NULL)
             {
-              if (strcmp (script, sp->name) == 0)
+              if (streq (script, sp->name))
                 script = NULL;
             }
           else if (memeq (xpg, "zh", 2))
@@ -530,7 +530,7 @@ bcp47_to_xpg (char *xpg, const char *bcp47, const char *codeset)
             default_script_for_language2 (xpg);
           if (sp != NULL)
             {
-              if (strcmp (script, sp->name) == 0)
+              if (streq (script, sp->name))
                 script = NULL;
             }
           else if (memeq (xpg, "iu", 2))
@@ -545,7 +545,7 @@ bcp47_to_xpg (char *xpg, const char *bcp47, const char *codeset)
             default_script_for_language3 (xpg);
           if (sp != NULL)
             {
-              if (strcmp (script, sp->name) == 0)
+              if (streq (script, sp->name))
                 script = NULL;
             }
           else if (memeq (xpg, "nan", 3))
index 65775cd1fb9d1f2a4551c750bc41c9a99afa88b5..6766bbd981fbfc2c33160589cec4317837dd90ca 100644 (file)
@@ -39,11 +39,11 @@ c32_get_mapping (const char *name)
     switch (name[2])
       {
       case 'l':
-        if (strcmp (name + 3, "ower") == 0)
+        if (streq (name + 3, "ower"))
           return c32tolower;
         break;
       case 'u':
-        if (strcmp (name + 3, "pper") == 0)
+        if (streq (name + 3, "pper"))
           return c32toupper;
         break;
       default:
index 7bfa922d782bd462a3c3ce75bf9f30d4c6aba003..e6824828726592d87bfd6ba5d73d3417e6c35532 100644 (file)
@@ -43,11 +43,11 @@ c32_get_type_test (const char *name)
           switch (name[2])
             {
             case 'n':
-              if (strcmp (name + 3, "um") == 0)
+              if (streq (name + 3, "um"))
                 return c32isalnum;
               break;
             case 'p':
-              if (strcmp (name + 3, "ha") == 0)
+              if (streq (name + 3, "ha"))
                 return c32isalpha;
               break;
             default:
@@ -59,34 +59,34 @@ c32_get_type_test (const char *name)
         }
       break;
     case 'b':
-      if (strcmp (name + 1, "lank") == 0)
+      if (streq (name + 1, "lank"))
         return c32isblank;
       break;
     case 'c':
-      if (strcmp (name + 1, "ntrl") == 0)
+      if (streq (name + 1, "ntrl"))
         return c32iscntrl;
       break;
     case 'd':
-      if (strcmp (name + 1, "igit") == 0)
+      if (streq (name + 1, "igit"))
         return c32isdigit;
       break;
     case 'g':
-      if (strcmp (name + 1, "raph") == 0)
+      if (streq (name + 1, "raph"))
         return c32isgraph;
       break;
     case 'l':
-      if (strcmp (name + 1, "ower") == 0)
+      if (streq (name + 1, "ower"))
         return c32islower;
       break;
     case 'p':
       switch (name[1])
         {
         case 'r':
-          if (strcmp (name + 2, "int") == 0)
+          if (streq (name + 2, "int"))
             return c32isprint;
           break;
         case 'u':
-          if (strcmp (name + 2, "nct") == 0)
+          if (streq (name + 2, "nct"))
             return c32ispunct;
           break;
         default:
@@ -94,15 +94,15 @@ c32_get_type_test (const char *name)
         }
       break;
     case 's':
-      if (strcmp (name + 1, "pace") == 0)
+      if (streq (name + 1, "pace"))
         return c32isspace;
       break;
     case 'u':
-      if (strcmp (name + 1, "pper") == 0)
+      if (streq (name + 1, "pper"))
         return c32isupper;
       break;
     case 'x':
-      if (strcmp (name + 1, "digit") == 0)
+      if (streq (name + 1, "digit"))
         return c32isxdigit;
       break;
     default:
index ccb55c05995c1018e578f65519975c9f3b7968ab..3524f4e41940b45c0837ac4416726b763d823fab 100644 (file)
@@ -39,7 +39,7 @@ concatenated_filename (const char *directory, const char *filename,
   char *result;
   char *p;
 
-  if (strcmp (directory, ".") == 0)
+  if (streq (directory, "."))
     {
       /* No need to prepend the directory.  */
       result = (char *) malloc (strlen (filename)
index 88fd4deaf0b233f0e0e7bfda9f90189d254663d1..8905680d09ffe5b74213a4d2bb2c779c29b7cff6 100644 (file)
 
 
 
-# ifndef STREQ
-#  define STREQ(a, b) (strcmp (a, b) == 0)
-# endif
-
 /* Return the glibc.cpu.hwcaps setting (prepended with "-"),
    corresponding to the passed gcc _builtin_cpu_supports(FEATURE).
    Supported hwcaps can be identified from the bit_cpu_* defines
@@ -68,14 +64,14 @@ gcc_feature_to_glibc_hwcap (char const *feature)
   if (0)
     ;
 # if defined __x86_64__
-  else if (STREQ (feature, "avx"))          hwcap = "-AVX";
-  else if (STREQ (feature, "avx2"))         hwcap = "-AVX2";
-  else if (STREQ (feature, "avx512bw"))     hwcap = "-AVX512BW";
-  else if (STREQ (feature, "avx512f"))      hwcap = "-AVX512F";
-  else if (STREQ (feature, "pclmul"))       hwcap = "-PCLMULQDQ";
-  else if (STREQ (feature, "vpclmulqdq"))   hwcap = "-VPCLMULQDQ";
+  else if (streq (feature, "avx"))          hwcap = "-AVX";
+  else if (streq (feature, "avx2"))         hwcap = "-AVX2";
+  else if (streq (feature, "avx512bw"))     hwcap = "-AVX512BW";
+  else if (streq (feature, "avx512f"))      hwcap = "-AVX512F";
+  else if (streq (feature, "pclmul"))       hwcap = "-PCLMULQDQ";
+  else if (streq (feature, "vpclmulqdq"))   hwcap = "-VPCLMULQDQ";
 # elif defined __aarch64__
-  else if (STREQ (feature, "pmull"))        hwcap = "-PMULL";
+  else if (streq (feature, "pmull"))        hwcap = "-PMULL";
 # endif
 
   return hwcap;
index d0011afc489727963f8e77cce038075cc893c4e5..3720e6db94cdc23f9278e0f71b015b96350fb3a2 100644 (file)
--- a/lib/dfa.c
+++ b/lib/dfa.c
@@ -51,6 +51,7 @@
 # define c32isprint iswprint
 # define c32isspace iswspace
 # define mbszero(p) memset (p, 0, sizeof (mbstate_t))
+# define streq(a, b) (strcmp (a, b) == 0)
 #else
 /* Use ISO C 11 + gnulib API.  */
 # include <uchar.h>
    MMU will check anyway.  */
 #define assume_nonnull(x) assume ((x) != NULL)
 
-static bool
-str_eq (char const *a, char const *b)
-{
-  return strcmp (a, b) == 0;
-}
-
 static bool
 c_isdigit (char c)
 {
@@ -944,7 +939,7 @@ static const struct dfa_ctype *_GL_ATTRIBUTE_PURE
 find_pred (const char *str)
 {
   for (int i = 0; prednames[i].name; i++)
-    if (str_eq (str, prednames[i].name))
+    if (streq (str, prednames[i].name))
       return &prednames[i];
   return NULL;
 }
@@ -1023,8 +1018,8 @@ parse_bracket_exp (struct dfa *dfa)
                    worry about that possibility.  */
                 {
                   char const *class
-                    = (dfa->syntax.case_fold && (str_eq (str, "upper")
-                                                 || str_eq (str, "lower"))
+                    = (dfa->syntax.case_fold && (streq (str, "upper")
+                                                 || streq (str, "lower"))
                        ? "alpha" : str);
                   const struct dfa_ctype *pred = find_pred (class);
                   if (!pred)
@@ -4207,7 +4202,7 @@ dfamust (struct dfa const *d)
             idx_t j, ln, rn, n;
 
             /* Guaranteed to be.  Unlikely, but ...  */
-            if (str_eq (lmp->is, rmp->is))
+            if (streq (lmp->is, rmp->is))
               {
                 lmp->begline &= rmp->begline;
                 lmp->endline &= rmp->endline;
@@ -4254,7 +4249,7 @@ dfamust (struct dfa const *d)
           for (idx_t i = 0; mp->in[i] != NULL; i++)
             if (strlen (mp->in[i]) > strlen (result))
               result = mp->in[i];
-          if (str_eq (result, mp->is))
+          if (streq (result, mp->is))
             {
               if ((!need_begline || mp->begline) && (!need_endline
                                                      || mp->endline))
index d1ba3aa772d1f3a230242c0306ae99a8421fe4e7..6be27459cd8322dbc83f687d39a673b639d2b9ee 100644 (file)
@@ -95,7 +95,7 @@ duplocale (locale_t locale)
               errno = err;
               return NULL;
             }
-          if (strcmp (name, base_name) != 0)
+          if (!streq (name, base_name))
             {
               locale_t copy = newlocale (category_mask, name, base_copy);
               if (copy == NULL)
index cdc57d9df883341c9708344d8728b25af11ec735..209f81130d662c08a1b31ddd7b611eff58fcce33 100644 (file)
@@ -240,7 +240,7 @@ string_hasher_ci (void const *data, size_t n_buckets)
 static bool
 string_compare (void const *data1, void const *data2)
 {
-  return strcmp (data1, data2) == 0;
+  return streq (data1, data2);
 }
 
 /* compare two strings for equality, case-insensitive */
@@ -659,7 +659,7 @@ add_exclude_file (void (*add_func) (struct exclude *, char const *, int),
                   struct exclude *ex, char const *file_name, int options,
                   char line_end)
 {
-  if (strcmp (file_name, "-") == 0)
+  if (streq (file_name, "-"))
     return add_exclude_fp (call_addfn, ex, stdin, options, line_end, &add_func);
 
   FILE *in = fopen (file_name, "re");
index a07dee534deca330e98c4968d764a4e7e5eb41c7..6d6ade672d0357307962292562023245dd1be8ce 100644 (file)
@@ -156,7 +156,7 @@ find_in_given_path (const char *progname, const char *path,
                             if (! S_ISDIR (statbuf.st_mode))
                               {
                                 /* Found!  */
-                                if (strcmp (progpathname, progname) == 0)
+                                if (streq (progpathname, progname))
                                   {
                                     free (progpathname);
                                     return progname;
@@ -308,7 +308,7 @@ find_in_given_path (const char *progname, const char *path,
                         if (! S_ISDIR (statbuf.st_mode))
                           {
                             /* Found!  */
-                            if (strcmp (progpathname, progname) == 0)
+                            if (streq (progpathname, progname))
                               {
                                 free (progpathname);
 
index d62a596d24ea37ed6d432bd08c5711c46589c43b..bf67452d0a228553727cf3e8328e6ecbe27a7bb1 100644 (file)
@@ -114,7 +114,7 @@ find_in_path (const char *progname)
               && ! S_ISDIR (statbuf.st_mode))
             {
               /* Found!  */
-              if (strcmp (progpathname, progname) == 0)
+              if (streq (progpathname, progname))
                 {
                   free (progpathname);
 
index 586f6512633b6656f1cee9aba35ed20a65bdfa6a..0b72a61cc8ba7060829b9353ce831ea4755b107e 100644 (file)
@@ -54,7 +54,7 @@ rpl_fopen (const char *filename, const char *mode)
 #endif
 
 #if defined _WIN32 && ! defined __CYGWIN__
-  if (strcmp (filename, "/dev/null") == 0)
+  if (streq (filename, "/dev/null"))
     filename = "NUL";
 #endif
 
index b0a26eaa172fcecaec438275ad435e68048ada89..14c94d989f28e872cdbbc2bd8ba7fb3100196255 100644 (file)
@@ -47,7 +47,7 @@ rpl_freopen (const char *filename, const char *mode, FILE *stream)
   FILE *result;
 #if defined _WIN32 && ! defined __CYGWIN__
   char const *null_device = "NUL";
-  if (filename && strcmp (filename, "/dev/null") == 0)
+  if (filename && streq (filename, "/dev/null"))
     filename = null_device;
 #else
   char const *null_device = "/dev/null";
index b611e997d469dd091ad24f4347d4f33f6c000fa1..4ab2a96a9528ec4d129415fa3ea1933a5731bf75 100644 (file)
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -233,7 +233,6 @@ static int      fts_safe_changedir (FTS *, FTSENT *, int, const char *)
 #endif
 
 #define ISDOT(a)        (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])))
-#define STREQ(a, b)     (strcmp (a, b) == 0)
 
 #define CLR(opt)        (sp->fts_options &= ~(opt))
 #define ISSET(opt)      ((sp->fts_options & (opt)) != 0)
@@ -2048,7 +2047,7 @@ internal_function
 fts_safe_changedir (FTS *sp, FTSENT *p, int fd, char const *dir)
 {
         int ret;
-        bool is_dotdot = dir && STREQ (dir, "..");
+        bool is_dotdot = dir && streq (dir, "..");
         int newfd;
 
         /* This clause handles the unusual case in which FTS_NOCHDIR
@@ -2094,7 +2093,7 @@ fts_safe_changedir (FTS *sp, FTSENT *p, int fd, char const *dir)
            not "..", diropen's use of O_NOFOLLOW ensures we don't mistakenly
            follow a symlink, so we can avoid the expense of this fstat.  */
         if (ISSET(FTS_LOGICAL) || ! HAVE_WORKING_O_NOFOLLOW
-            || (dir && STREQ (dir, "..")))
+            || (dir && streq (dir, "..")))
           {
             struct stat sb;
             if (fstat(newfd, &sb))
index 4dbe7f5f13b6ed141d0a2c49e6a6f0936437742a..97f8ff4b0d8c5fc0cc7c1316ca0ef4bd63d3f4db 100644 (file)
@@ -64,7 +64,7 @@ str_endswith (const char *string, const char *suffix)
 {
   size_t len = strlen (string);
   size_t n = strlen (suffix);
-  return len >= n && strcmp (string + len - n, suffix) == 0;
+  return len >= n && streq (string + len - n, suffix);
 }
 
 static bool
@@ -73,6 +73,12 @@ memeq (void const *s1, void const *s2, size_t n)
   return !memcmp (s1, s2, n);
 }
 
+static bool
+streq (char const *s1, char const *s2)
+{
+  return !strcmp (s1, s2);
+}
+
 /* ========================================================================= */
 
 /* Reading UnicodeData.txt.  */
@@ -122,7 +128,7 @@ fill_attribute (unsigned int i,
       fprintf (stderr, "index too large\n");
       exit (1);
     }
-  if (strcmp (field2, "Cs") == 0)
+  if (streq (field2, "Cs"))
     /* Surrogates are UTF-16 artifacts, not real characters. Ignore them.  */
     return;
   uni = &unicode_attributes[i];
@@ -799,9 +805,9 @@ output_predicate (const char *filename, bool (*predicate) (unsigned int), const
   fprintf (stream, "/* Copyright (C) 2000-2025 Free Software Foundation, Inc.\n");
   fprintf (stream, "\n");
   output_library_license (stream,
-                          strcmp (filename, "unictype/categ_M.h") == 0
+                          streq (filename, "unictype/categ_M.h")
                           || str_startswith (filename, "unictype/ctype_")
-                          || strcmp (filename, "uniwidth/width2.h") == 0);
+                          || streq (filename, "uniwidth/width2.h"));
   fprintf (stream, "\n");
 
   t.p = 4; /* or: 5 */
@@ -2946,7 +2952,7 @@ fill_properties (const char *proplist_filename)
           i2 = i1;
         }
 #define PROP(name,code) \
-      if (strcmp (propname, name) == 0) propcode = code; else
+      if (streq (propname, name)) propcode = code; else
       /* PropList.txt */
       PROP ("White_Space", PROP_WHITE_SPACE)
       PROP ("Bidi_Control", PROP_BIDI_CONTROL)
@@ -3015,7 +3021,7 @@ fill_properties (const char *proplist_filename)
       PROP ("Extended_Pictographic", PROP_EXTENDED_PICTOGRAPHIC)
 #undef PROP
       /* An enum-valued property from DerivedCoreProperties.txt */
-      if (strcmp (propname, "InCB;") == 0)
+      if (streq (propname, "InCB;"))
         {
           char valuename[200+1];
           unsigned int valuecode;
@@ -3026,13 +3032,13 @@ fill_properties (const char *proplist_filename)
               exit (1);
             }
 
-          if (strcmp (valuename, "None") == 0)
+          if (streq (valuename, "None"))
             valuecode = UC_INDIC_CONJUNCT_BREAK_NONE;
-          else if (strcmp (valuename, "Consonant") == 0)
+          else if (streq (valuename, "Consonant"))
             valuecode = UC_INDIC_CONJUNCT_BREAK_CONSONANT;
-          else if (strcmp (valuename, "Linker") == 0)
+          else if (streq (valuename, "Linker"))
             valuecode = UC_INDIC_CONJUNCT_BREAK_LINKER;
-          else if (strcmp (valuename, "Extend") == 0)
+          else if (streq (valuename, "Extend"))
             valuecode = UC_INDIC_CONJUNCT_BREAK_EXTEND;
           else
             {
@@ -3741,7 +3747,7 @@ is_property_iso_control (unsigned int ch)
 {
   bool result1 =
     (unicode_attributes[ch].name != NULL
-     && strcmp (unicode_attributes[ch].name, "<control>") == 0);
+     && streq (unicode_attributes[ch].name, "<control>"));
   bool result2 =
     is_category_Cc (ch);
 
@@ -3871,7 +3877,7 @@ static bool
 is_property_combining (unsigned int ch)
 {
   return (unicode_attributes[ch].name != NULL
-          && (strcmp (unicode_attributes[ch].combining, "0") != 0
+          && (!streq (unicode_attributes[ch].combining, "0")
               || is_category_Mc (ch)
               || is_category_Me (ch)
               || is_category_Mn (ch)));
@@ -4497,7 +4503,7 @@ fill_arabicshaping (const char *arabicshaping_filename)
         }
       assert (i < 0x110000);
 
-#define TRY(name) else if (strcmp (joining_type_name, #name + 16) == 0) joining_type = name;
+#define TRY(name) else if (streq (joining_type_name, #name + 16)) joining_type = name;
       if (false) {}
       TRY(UC_JOINING_TYPE_U)
       TRY(UC_JOINING_TYPE_T)
@@ -4518,7 +4524,7 @@ fill_arabicshaping (const char *arabicshaping_filename)
              && joining_group_name[strlen (joining_group_name) - 1] == ' ')
         joining_group_name[strlen (joining_group_name) - 1] = '\0';
 
-#define TRY(value,name) else if (strcmp (joining_group_name, name) == 0) joining_group = value;
+#define TRY(value,name) else if (streq (joining_group_name, name)) joining_group = value;
       if (false) {}
       TRY(UC_JOINING_GROUP_NONE,                     "No_Joining_Group")
       TRY(UC_JOINING_GROUP_AIN,                      "AIN")
@@ -5223,7 +5229,7 @@ fill_scripts (const char *scripts_filename)
       assert (i2 < 0x110000);
 
       for (script = numscripts - 1; script >= 0; script--)
-        if (strcmp (scripts[script], scriptname) == 0)
+        if (streq (scripts[script], scriptname))
           break;
       if (script < 0)
         {
@@ -6321,7 +6327,7 @@ static bool
 is_cntrl (unsigned int ch)
 {
   return (unicode_attributes[ch].name != NULL
-          && (strcmp (unicode_attributes[ch].name, "<control>") == 0
+          && (streq (unicode_attributes[ch].name, "<control>")
               /* Categories Zl and Zp */
               || (unicode_attributes[ch].category[0] == 'Z'
                   && (unicode_attributes[ch].category[1] == 'l'
@@ -6354,7 +6360,7 @@ static bool
 is_graph (unsigned int ch)
 {
   return (unicode_attributes[ch].name != NULL
-          && strcmp (unicode_attributes[ch].name, "<control>")
+          && !streq (unicode_attributes[ch].name, "<control>")
           && !is_space (ch));
 }
 
@@ -6362,7 +6368,7 @@ static bool
 is_print (unsigned int ch)
 {
   return (unicode_attributes[ch].name != NULL
-          && strcmp (unicode_attributes[ch].name, "<control>")
+          && !streq (unicode_attributes[ch].name, "<control>")
           /* Categories Zl and Zp */
           && !(unicode_attributes[ch].name != NULL
                && unicode_attributes[ch].category[0] == 'Z'
@@ -7119,12 +7125,12 @@ symbolic_width (unsigned int ch)
         return '0';
       /* Test for double-width character.  */
       if (unicode_width[ch] != NULL
-          && (strcmp (unicode_width[ch], "W") == 0
-              || strcmp (unicode_width[ch], "F") == 0))
+          && (streq (unicode_width[ch], "W")
+              || streq (unicode_width[ch], "F")))
         return '2';
       /* Test for half-width character.  */
       if (unicode_width[ch] != NULL
-          && strcmp (unicode_width[ch], "H") == 0)
+          && streq (unicode_width[ch], "H"))
         return '1';
     }
   /* In ancient CJK encodings, Cyrillic and most other characters are
@@ -7266,9 +7272,9 @@ static int
 get_lbea (unsigned int ch)
 {
   return (unicode_width[ch] != NULL
-          && (strcmp (unicode_width[ch], "W") == 0
-              || strcmp (unicode_width[ch], "F") == 0
-              || strcmp (unicode_width[ch], "H") == 0));
+          && (streq (unicode_width[ch], "W")
+              || streq (unicode_width[ch], "F")
+              || streq (unicode_width[ch], "H")));
 }
 
 /* Returns the line breaking classification for ch, as a bit mask.  */
@@ -8809,7 +8815,7 @@ fill_org_lbp (const char *linebreak_filename)
       /* Remove trailing spaces from field1.  */
       while (strlen (field1) > 0 && field1[strlen (field1) - 1] == ' ')
         field1[strlen (field1) - 1] = '\0';
-#define TRY(bit) else if (strcmp (field1, #bit + 4) == 0) value = bit;
+#define TRY(bit) else if (streq (field1, #bit + 4)) value = bit;
       if (false) {}
       TRY(LBP_BK)
       TRY(LBP_CR)
@@ -8857,9 +8863,9 @@ fill_org_lbp (const char *linebreak_filename)
       TRY(LBP_EM)
       TRY(LBP_XX)
 #undef TRY
-      else if (strcmp (field1, "NL") == 0) value = LBP_BK;
-      else if (strcmp (field1, "SG") == 0) value = LBP_XX;
-      else if (strcmp (field1, "CJ") == 0) value = LBP_NS;
+      else if (streq (field1, "NL")) value = LBP_BK;
+      else if (streq (field1, "SG")) value = LBP_XX;
+      else if (streq (field1, "CJ")) value = LBP_NS;
       else
         {
           fprintf (stderr, "unknown property value \"%s\" in '%s':%d\n",
@@ -9651,12 +9657,12 @@ get_wbp (unsigned int ch)
       if (((unicode_properties[ch] >> PROP_GRAPHEME_EXTEND) & 1) != 0
           || ((unicode_properties[ch] >> PROP_OTHER_GRAPHEME_EXTEND) & 1) != 0
           || (unicode_attributes[ch].category != NULL
-              && strcmp (unicode_attributes[ch].category, "Mc") == 0)
+              && streq (unicode_attributes[ch].category, "Mc"))
           || ((unicode_properties[ch] >> PROP_EMOJI_MODIFIER) & 1) != 0 /* Emoji modifier */)
         attr |= 1 << WBP_EXTEND;
 
       if (unicode_attributes[ch].category != NULL
-          && strcmp (unicode_attributes[ch].category, "Cf") == 0
+          && streq (unicode_attributes[ch].category, "Cf")
           && !(ch >= 0x0600 && ch <= 0x0605)
           && ch != 0x06DD
           && ch != 0x070F
@@ -9667,15 +9673,15 @@ get_wbp (unsigned int ch)
         attr |= 1 << WBP_FORMAT;
 
       if ((unicode_scripts[ch] < numscripts
-           && strcmp (scripts[unicode_scripts[ch]], "Katakana") == 0)
+           && streq (scripts[unicode_scripts[ch]], "Katakana"))
           || (ch >= 0x3031 && ch <= 0x3035)
           || ch == 0x309B || ch == 0x309C || ch == 0x30A0 || ch == 0x30FC
           || ch == 0xFF70)
         attr |= 1 << WBP_KATAKANA;
 
       if ((unicode_scripts[ch] < numscripts
-           && strcmp (scripts[unicode_scripts[ch]], "Hebrew") == 0)
-          && strcmp (unicode_attributes[ch].category, "Lo") == 0)
+           && streq (scripts[unicode_scripts[ch]], "Hebrew"))
+          && streq (unicode_attributes[ch].category, "Lo"))
         attr |= 1 << WBP_HL;
 
       if ((((unicode_properties[ch] >> PROP_ALPHABETIC) & 1) != 0
@@ -9698,7 +9704,7 @@ get_wbp (unsigned int ch)
           && (attr & (1 << WBP_KATAKANA)) == 0
           && ((get_lbp (ch) >> LBP_SA) & 1) == 0
           && !(unicode_scripts[ch] < numscripts
-               && strcmp (scripts[unicode_scripts[ch]], "Hiragana") == 0)
+               && streq (scripts[unicode_scripts[ch]], "Hiragana"))
           && (attr & (1 << WBP_EXTEND)) == 0
           && (attr & (1 << WBP_HL)) == 0)
         attr |= 1 << WBP_ALETTER;
@@ -9728,7 +9734,7 @@ get_wbp (unsigned int ch)
         attr |= 1 << WBP_NUMERIC;
 
       if ((unicode_attributes[ch].category != NULL
-           && strcmp (unicode_attributes[ch].category, "Pc") == 0)
+           && streq (unicode_attributes[ch].category, "Pc"))
           || ch == 0x202F /* NARROW NO-BREAK SPACE */)
         attr |= 1 << WBP_EXTENDNUMLET;
 
@@ -9875,7 +9881,7 @@ fill_org_wbp (const char *wordbreakproperty_filename)
           i2 = i1;
         }
 #define PROP(name,value) \
-      if (strcmp (propname, name) == 0) propvalue = value; else
+      if (streq (propname, name)) propvalue = value; else
       PROP ("CR", WBP_CR)
       PROP ("LF", WBP_LF)
       PROP ("Newline", WBP_NEWLINE)
@@ -10455,7 +10461,7 @@ fill_org_gbp (const char *graphemebreakproperty_filename)
           i2 = i1;
         }
 #define PROP(name,value) \
-      if (strcmp (propname, name) == 0) propvalue = value; else
+      if (streq (propname, name)) propvalue = value; else
       PROP ("CR", GBP_CR)
       PROP ("LF", GBP_LF)
       PROP ("Control", GBP_CONTROL)
@@ -10863,13 +10869,13 @@ debug_output_composition_tables (const char *filename)
 
           /* Exclude decompositions where the first part is not a starter,
              i.e. is not of canonical combining class 0.  */
-          if (strcmp (unicode_attributes[code1].combining, "0") == 0
+          if (streq (unicode_attributes[code1].combining, "0")
               /* Exclude characters listed in CompositionExclusions.txt.  */
               && !unicode_composition_exclusions[combined])
             {
               /* The combined character must now also be a starter.
                  Verify this.  */
-              assert (strcmp (unicode_attributes[combined].combining, "0") == 0);
+              assert (streq (unicode_attributes[combined].combining, "0"));
 
               fprintf (stream, "0x%04X\t0x%04X\t0x%04X\t%s\n",
                        code1,
@@ -10965,13 +10971,13 @@ output_composition_tables (const char *filename, const char *filename2,
 
           /* Exclude decompositions where the first part is not a starter,
              i.e. is not of canonical combining class 0.  */
-          if (strcmp (unicode_attributes[code1].combining, "0") == 0
+          if (streq (unicode_attributes[code1].combining, "0")
               /* Exclude characters listed in CompositionExclusions.txt.  */
               && !unicode_composition_exclusions[combined])
             {
               /* The combined character must now also be a starter.
                  Verify this.  */
-              assert (strcmp (unicode_attributes[combined].combining, "0") == 0);
+              assert (streq (unicode_attributes[combined].combining, "0"));
 
               if (max_code1 < code1)
                 max_code1 = code1;
@@ -11120,8 +11126,8 @@ output_simple_mapping (const char *filename,
   fprintf (stream, "/* Copyright (C) 2000-2025 Free Software Foundation, Inc.\n");
   fprintf (stream, "\n");
   output_library_license (stream,
-                          strcmp (filename, "unicase/tolower.h") == 0
-                          || strcmp (filename, "unicase/toupper.h") == 0);
+                          streq (filename, "unicase/tolower.h")
+                          || streq (filename, "unicase/toupper.h"));
   fprintf (stream, "\n");
 
   t.p = 7;
@@ -11710,7 +11716,7 @@ redistribute_casefolding_rules (void)
               if (rule->code == cfrule->code
                   && (cfrule->language == NULL
                       || (rule->language != NULL
-                          && strcmp (rule->language, cfrule->language) == 0)))
+                          && streq (rule->language, cfrule->language))))
                 {
                   memcpy (rule->casefold_mapping, cfrule->mapping,
                           sizeof (rule->casefold_mapping));
@@ -11718,7 +11724,7 @@ redistribute_casefolding_rules (void)
                   if ((cfrule->language == NULL
                        ? rule->language == NULL
                        : rule->language != NULL
-                         && strcmp (rule->language, cfrule->language) == 0)
+                         && streq (rule->language, cfrule->language))
                       && rule->context == SCC_ALWAYS)
                     {
                       /* Found it.  */
index 4e1c3b45c4bac2fce4a47360f97c96d7352b5abe..6dd458e40c0b6809ce52c2dc96beb1ed3ef40c55 100644 (file)
@@ -60,7 +60,7 @@ map_to_failure (int ret, char **con)
       return -1;
     }
 
-  if (ret == 10 && strcmp (*con, "unlabeled") == 0)
+  if (ret == 10 && streq (*con, "unlabeled"))
     {
       freecon (*con);
       *con = NULL;
index 47721115676b2b5f259bfef511f001906a89292f..36965f1db5bbc2feb9619aef2090dcf45a6912ed 100644 (file)
@@ -94,7 +94,7 @@ getlogin (void)
               {
                 idx_t i;
                 for (i = 0; i < n; i++)
-                  if (strcmp (entries[i].ut_line, tty + 5) == 0)
+                  if (streq (entries[i].ut_line, tty + 5))
                     {
                       if (strlen (entries[i].ut_user) < 64)
                         {
index 354cfa9976c83fe9121d76fc4196e743b3914081..5f48d56ec4d9ae44e6d007f9a3d79a060399bbab 100644 (file)
@@ -48,8 +48,6 @@ getugroups (_GL_UNUSED int maxcount,
 #else /* HAVE_GRP_H */
 # include <grp.h>
 
-# define STREQ(a, b) (strcmp (a, b) == 0)
-
 /* Like 'getgroups', but for user USERNAME instead of for the current
    process.  Store at most MAXCOUNT group IDs in the GROUPLIST array.
    If GID is not -1, store it first (if possible).  GID should be the
@@ -85,7 +83,7 @@ getugroups (int maxcount, gid_t *grouplist, char const *username,
         {
           int n;
 
-          if ( ! STREQ (username, *cp))
+          if (!streq (username, *cp))
             continue;
 
           /* See if this group number is already on the list.  */
index 767906d11e9b568f61228202733c3e47d56e0cf7..1e430889506175bb24bd7a25a1de4a0c11bf8798 100644 (file)
@@ -32,7 +32,7 @@ hard_locale (int category)
   if (setlocale_null_r (category, locale, sizeof (locale)))
     return false;
 
-  if (!(strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0))
+  if (!(streq (locale, "C") || streq (locale, "POSIX")))
     return true;
 
 #if defined __ANDROID__
index 1611cb513859fb46a0e80478e0dd893bf8c6c07a..df5028f01434cc41563464d95e2dfb1150e0461d 100644 (file)
@@ -27,8 +27,6 @@
 #include "hashcode-string2.h"
 #include "same-inode.h"
 
-#define STREQ(a, b) (strcmp (a, b) == 0)
-
 /* Hash an F_triple, and *do* consider the file name.  */
 size_t
 triple_hash (void const *x, size_t table_size)
@@ -46,7 +44,7 @@ triple_compare_ino_str (void const *x, void const *y)
 {
   struct F_triple const *a = x;
   struct F_triple const *b = y;
-  return PSAME_INODE (a, b) && STREQ (a->name, b->name);
+  return PSAME_INODE (a, b) && streq (a->name, b->name);
 }
 
 /* Free an F_triple.  */
index 7517780d5f7ed6b53279c279d36bec07c24ba2ef..897e1bed41c659ee3ffb687fb47d1273e5d16d0f 100644 (file)
@@ -27,7 +27,7 @@ hashkey_string_equals (const void *x1, const void *x2)
 {
   const char *s1 = (const char *) x1;
   const char *s2 = (const char *) x2;
-  return strcmp (s1, s2) == 0;
+  return streq (s1, s2);
 }
 
 #define SIZE_BITS (sizeof (size_t) * CHAR_BIT)
index 544edbe3f9d00bf146ae90635157e23ce8a75646..c54b8ee603432ceeda0508e1ef85c4079e6d4a09 100644 (file)
@@ -67,7 +67,7 @@ rpl_iconv_open (const char *tocode, const char *fromcode)
           && c_toupper (tocode[2]) == 'F'
           && tocode[3] == '-')
         {
-          if (strcmp (fromcode + 4, "8") == 0)
+          if (streq (fromcode + 4, "8"))
             {
               if (c_strcasecmp (tocode + 4, "16BE") == 0)
                 return _ICONV_UTF8_UTF16BE;
@@ -78,7 +78,7 @@ rpl_iconv_open (const char *tocode, const char *fromcode)
               if (c_strcasecmp (tocode + 4, "32LE") == 0)
                 return _ICONV_UTF8_UTF32LE;
             }
-          else if (strcmp (tocode + 4, "8") == 0)
+          else if (streq (tocode + 4, "8"))
             {
               if (c_strcasecmp (fromcode + 4, "16BE") == 0)
                 return _ICONV_UTF16BE_UTF8;
index 18c33fcf0ec77bf9955ccb31a29c03c90d3cb7f9..5907838be49a75ca36b801fc2a9997cf3a86f14d 100644 (file)
@@ -109,12 +109,12 @@ getuidbyname (const char *user)
 
   for (tail = user_alist; tail; tail = tail->next)
     /* Avoid a function call for the most common case.  */
-    if (*tail->name == *user && !strcmp (tail->name, user))
+    if (*tail->name == *user && streq (tail->name, user))
       return &tail->id.u;
 
   for (tail = nouser_alist; tail; tail = tail->next)
     /* Avoid a function call for the most common case.  */
-    if (*tail->name == *user && !strcmp (tail->name, user))
+    if (*tail->name == *user && streq (tail->name, user))
       return NULL;
 
   pwent = getpwnam (user);
@@ -191,12 +191,12 @@ getgidbyname (const char *group)
 
   for (tail = group_alist; tail; tail = tail->next)
     /* Avoid a function call for the most common case.  */
-    if (*tail->name == *group && !strcmp (tail->name, group))
+    if (*tail->name == *group && streq (tail->name, group))
       return &tail->id.g;
 
   for (tail = nogroup_alist; tail; tail = tail->next)
     /* Avoid a function call for the most common case.  */
-    if (*tail->name == *group && !strcmp (tail->name, group))
+    if (*tail->name == *group && streq (tail->name, group))
       return NULL;
 
   grent = getgrnam (group);
index 448619b68741a8352deb57666cfea1ff509cdff9..08369f546b7ffc9af6ab9446b3d13823379ce18d 100644 (file)
@@ -109,7 +109,7 @@ get_converters (const char *encoding)
       strcpy (conv->encoding, encoding);
       gl_tls_set (converters_key, conv);
     }
-  else if (strcmp (conv->encoding, encoding) != 0)
+  else if (!streq (conv->encoding, encoding))
     {
       /* The locale encoding of this thread changed.  */
       iconv_t new_cd_locale_to_utf8 = iconv_open ("UTF-8", encoding);
index 29dba9852a4ba26bba9ac7fed66d912ca6fc7497..57b9c9da4a5252141e129b4a272234f811c9667c 100644 (file)
@@ -811,7 +811,7 @@ locale_charset (void)
   /* Cygwin < 1.7 does not have locales.  nl_langinfo (CODESET) always
      returns "US-ASCII".  Return the suffix of the locale name from the
      environment variables (if present) or the codepage as a number.  */
-  if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0)
+  if (codeset != NULL && streq (codeset, "US-ASCII"))
     {
       const char *locale;
       static char resultbuf[2 + 10 + 1];
@@ -902,8 +902,7 @@ locale_charset (void)
   /* For a locale name such as "French_France.65001", in Windows 10,
      setlocale now returns "French_France.utf8" instead, or in the UTF-8
      environment (with modern system settings) "fr_FR.UTF-8".  */
-  if (strcmp (buf + 2, "65001") == 0 || strcmp (buf + 2, "utf8") == 0
-      || strcmp (buf + 2, "UTF-8") == 0)
+  if (streq (buf + 2, "65001") || streq (buf + 2, "utf8") || streq (buf + 2, "UTF-8"))
     codeset = "UTF-8";
   else
     {
@@ -953,7 +952,7 @@ locale_charset (void)
         }
 
       /* For the POSIX locale, don't use the system's codepage.  */
-      if (strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0)
+      if (streq (locale, "C") || streq (locale, "POSIX"))
         codeset = "";
     }
 
@@ -985,7 +984,7 @@ locale_charset (void)
        Speed up the common case and slow down the less common cases by
        testing for this case first.  */
 #  if defined __OpenBSD__ || (defined __APPLE__ && defined __MACH__) || defined __sun || defined __CYGWIN__
-    if (strcmp (codeset, "UTF-8") == 0)
+    if (streq (codeset, "UTF-8"))
       goto done_table_lookup;
     else
 #  endif
@@ -1114,7 +1113,7 @@ locale_charset (void)
 #ifdef DARWIN7
   /* Mac OS X sets MB_CUR_MAX to 1 when LC_ALL=C, and "UTF-8"
      (the default codeset) does not work when MB_CUR_MAX is 1.  */
-  if (strcmp (codeset, "UTF-8") == 0 && MB_CUR_MAX_L (uselocale (NULL)) <= 1)
+  if (ostreq (codeset, "UTF-8") && MB_CUR_MAX_L (uselocale (NULL)) <= 1)
     codeset = "ASCII";
 #endif
 
index fea88fa88e4826e8e20712c31797fd2754f49200..0d35d6bbde0a516ba4a96b68b89b462e1eb65df3 100644 (file)
@@ -44,12 +44,12 @@ gl_locale_name_environ (_GL_UNUSED int category, const char *categoryname)
 #if HAVE_CFPREFERENCESCOPYAPPVALUE
       /* Mac OS X 10.2 or newer.
          Ignore invalid LANG value set by the Terminal application.  */
-      if (strcmp (retval, "UTF-8") != 0)
+      if (!streq (retval, "UTF-8"))
 #endif
 #if defined __CYGWIN__
       /* Cygwin.
          Ignore dummy LANG value set by ~/.profile.  */
-      if (strcmp (retval, "C.UTF-8") != 0)
+       if (!streq (retval, "C.UTF-8"))
 #endif
         return retval;
     }
index 35fddfbfe933949eb044954cc2ca54bf566e52b3..708aa28569b1b7e44de56ed34a699fbf395b9c44 100644 (file)
@@ -1377,7 +1377,7 @@ gl_locale_name_canonicalize (char *name)
           else
             i1 = i;
         }
-      if (strcmp (name, legacy_table[i1].legacy) == 0)
+      if (streq (name, legacy_table[i1].legacy))
         {
           strcpy (name, legacy_table[i1].unixy);
           return;
@@ -1401,7 +1401,7 @@ gl_locale_name_canonicalize (char *name)
           else
             i1 = i;
         }
-      if (strcmp (name, langtag_table[i1].langtag) == 0)
+      if (streq (name, langtag_table[i1].langtag))
         {
           strcpy (name, langtag_table[i1].unixy);
           return;
@@ -1420,7 +1420,7 @@ gl_locale_name_canonicalize (char *name)
           else
             i1 = i;
         }
-      if (strcmp (name + 3, script_table[i1].script) == 0)
+      if (streq (name + 3, script_table[i1].script))
         {
           name[2] = '@';
           strcpy (name + 3, script_table[i1].unixy);
@@ -2593,7 +2593,7 @@ get_lcid (const char *locale_name)
   /* Lock while looking for an LCID, to protect access to static
      variables: last_lcid, last_locale, found_lcid, and lname.  */
   glwthread_mutex_lock (&get_lcid_lock);
-  if (last_lcid > 0 && strcmp (locale_name, last_locale) == 0)
+  if (last_lcid > 0 && streq (locale_name, last_locale))
     {
       glwthread_mutex_unlock (&get_lcid_lock);
       return last_lcid;
index 5a7ff13ad6501c5432a4abd21aef69e1e78078a0..d8faf772b0800ff677c26cb49694783769152b45 100644 (file)
@@ -67,7 +67,7 @@ mbs_endswith (const char *string, const char *suffix)
           if (!mbi_avail (iter))
             /* We can get here due to incomplete multibyte characters.  */
             return false;
-          return strcmp (mbi_cur_ptr (iter), suffix) == 0;
+          return streq (mbi_cur_ptr (iter), suffix);
         }
     }
   return false;
index 75e6c6590e8483531420dc6b5c680d3687dde637..1a1e7fbf7850a0aef03ed9e6723956d457853ef4 100644 (file)
 #endif
 
 #define ME_DUMMY_0(Fs_name, Fs_type)            \
-  (strcmp (Fs_type, "autofs") == 0              \
-   || strcmp (Fs_type, "proc") == 0             \
-   || strcmp (Fs_type, "subfs") == 0            \
+  (streq (Fs_type, "autofs")              \
+   || streq (Fs_type, "proc")             \
+   || streq (Fs_type, "subfs")            \
    /* for Linux 2.6/3.x */                      \
-   || strcmp (Fs_type, "debugfs") == 0          \
-   || strcmp (Fs_type, "devpts") == 0           \
-   || strcmp (Fs_type, "fusectl") == 0          \
-   || strcmp (Fs_type, "fuse.portal") == 0      \
-   || strcmp (Fs_type, "mqueue") == 0           \
-   || strcmp (Fs_type, "rpc_pipefs") == 0       \
-   || strcmp (Fs_type, "sysfs") == 0            \
+   || streq (Fs_type, "debugfs")          \
+   || streq (Fs_type, "devpts")           \
+   || streq (Fs_type, "fusectl")          \
+   || streq (Fs_type, "fuse.portal")      \
+   || streq (Fs_type, "mqueue")           \
+   || streq (Fs_type, "rpc_pipefs")       \
+   || streq (Fs_type, "sysfs")            \
    /* FreeBSD, Linux 2.4 */                     \
-   || strcmp (Fs_type, "devfs") == 0            \
+   || streq (Fs_type, "devfs")            \
    /* for NetBSD 3.0 */                         \
-   || strcmp (Fs_type, "kernfs") == 0)
+   || streq (Fs_type, "kernfs"))
 
 /* Historically, we have marked as "dummy" any file system of type "none",
    but now that programs like du need to know about bind-mounted directories,
 #ifdef MOUNTED_GETMNTENT1
 # define ME_DUMMY(Fs_name, Fs_type, Bind) \
   (ME_DUMMY_0 (Fs_name, Fs_type) \
-   || (strcmp (Fs_type, "none") == 0 && !Bind))
+   || (streq (Fs_type, "none") && !Bind))
 #else
 # define ME_DUMMY(Fs_name, Fs_type) \
-  (ME_DUMMY_0 (Fs_name, Fs_type) || strcmp (Fs_type, "none") == 0)
+  (ME_DUMMY_0 (Fs_name, Fs_type) || streq (Fs_type, "none"))
 #endif
 
 #ifdef __CYGWIN__
@@ -238,19 +238,19 @@ me_remote (char const *fs_name, _GL_UNUSED char const *fs_type)
     (strchr (Fs_name, ':') != NULL              \
      || ((Fs_name)[0] == '/'                    \
          && (Fs_name)[1] == '/'                 \
-         && (strcmp (Fs_type, "smbfs") == 0     \
-             || strcmp (Fs_type, "smb3") == 0   \
-             || strcmp (Fs_type, "cifs") == 0)) \
-     || strcmp (Fs_type, "acfs") == 0           \
-     || strcmp (Fs_type, "afs") == 0            \
-     || strcmp (Fs_type, "coda") == 0           \
-     || strcmp (Fs_type, "auristorfs") == 0     \
-     || strcmp (Fs_type, "fhgfs") == 0          \
-     || strcmp (Fs_type, "gpfs") == 0           \
-     || strcmp (Fs_type, "ibrix") == 0          \
-     || strcmp (Fs_type, "ocfs2") == 0          \
-     || strcmp (Fs_type, "vxfs") == 0           \
-     || strcmp ("-hosts", Fs_name) == 0)
+         && (streq (Fs_type, "smbfs")     \
+             || streq (Fs_type, "smb3")   \
+             || streq (Fs_type, "cifs"))) \
+     || streq (Fs_type, "acfs")           \
+     || streq (Fs_type, "afs")            \
+     || streq (Fs_type, "coda")           \
+     || streq (Fs_type, "auristorfs")     \
+     || streq (Fs_type, "fhgfs")          \
+     || streq (Fs_type, "gpfs")           \
+     || streq (Fs_type, "ibrix")          \
+     || streq (Fs_type, "ocfs2")          \
+     || streq (Fs_type, "vxfs")           \
+     || streq ("-hosts", Fs_name))
 #endif
 
 #if MOUNTED_GETMNTINFO          /* Mac OS X, FreeBSD, OpenBSD, also (obsolete) 4.4BSD */
@@ -695,10 +695,10 @@ read_file_system_list (bool need_fs_type)
             char *name;
             struct stat statbuf;
 
-            if (strcmp (d->d_name, "..") == 0)
+            if (streq (d->d_name, ".."))
               continue;
 
-            if (strcmp (d->d_name, ".") == 0)
+            if (streq (d->d_name, "."))
               name = xstrdup ("/");
             else
               {
index 7635fb691f1c8e16b35696fb3443eb064cf79aa5..7dfa0a9a42b382f81d35e065d86f08da1b36da96 100644 (file)
@@ -48,7 +48,7 @@ newlocale (int category_mask, const char *name, locale_t base)
   if (category_mask != 0)
     {
       /* Test whether NAME is valid.  */
-      if (!(strcmp (name, "C") == 0 || strcmp (name, "POSIX") == 0))
+      if (!(streq (name, "C") || streq (name, "POSIX")))
         {
           char *filename = (char *) malloc (18 + strlen (name) + 9 + 1);
           if (filename == NULL)
@@ -110,13 +110,13 @@ newlocale (int category_mask, const char *name, locale_t base)
     }
 
   /* Canonicalize the name.  */
-  if (strcmp (name, "POSIX") == 0)
+  if (streq (name, "POSIX"))
     name = "C";
 
 # if !HAVE_WINDOWS_LOCALE_T
   /* In this case, the only NAMEs that we support are "C" and (equivalently)
      "POSIX".  */
-  if (category_mask != 0 && strcmp (name, "C") != 0)
+  if (category_mask != 0 && !streq (name, "C"))
     {
       errno = ENOENT;
       return NULL;
@@ -164,7 +164,7 @@ newlocale (int category_mask, const char *name, locale_t base)
               err = ENOMEM;
               goto fail_with_err;
             }
-          if (strcmp (lcname, "C") == 0)
+          if (streq (lcname, "C"))
             {
               result->category[i].is_c_locale = true;
 # if HAVE_WINDOWS_LOCALE_T
index df824a61f81013e89abc4ec1c0254e264a930ac4..e7a9334ec909ba94a31211a4cd969332691d6324 100644 (file)
@@ -128,7 +128,7 @@ ctype_codeset (void)
     sprintf (buf + 2, "%u", GetACP ());
   /* For a locale name such as "French_France.65001", in Windows 10,
      setlocale now returns "French_France.utf8" instead.  */
-  if (strcmp (buf + 2, "65001") == 0 || strcmp (buf + 2, "utf8") == 0)
+  if (streq (buf + 2, "65001") || streq (buf + 2, "utf8"))
     return (char *) "UTF-8";
   else
     {
index f63d19a6464765d8c6ca151d43e44b68dd04d97f..e899ff17620cb72c92efd5ae05276e13c633eb12 100644 (file)
@@ -392,7 +392,7 @@ cgroup2_mount (void)
     return NULL;
   while ((mnt = getmntent (fp)) != NULL)
     {
-      if (strcmp (mnt->mnt_type, "cgroup2") == 0)
+      if (streq (mnt->mnt_type, "cgroup2"))
         {
           ret = strdup (mnt->mnt_dir);
           break;
index 7fae7d5ae94d2d1dca0f83e5f2bfbd1c5c9cf7e5..fceacfcc00ffabbdbf15fd7ba179814c07de51a7 100644 (file)
@@ -94,7 +94,7 @@ open (const char *filename, int flags, ...)
 #endif
 
 #if defined _WIN32 && ! defined __CYGWIN__
-  if (strcmp (filename, "/dev/null") == 0)
+  if (streq (filename, "/dev/null"))
     filename = "NUL";
 #endif
 
index 0bdf27162b27b55fb01dfe46440dcf215ad65a03..c532c070782d3ae991be00d9d6947ea995fd1100 100644 (file)
@@ -195,7 +195,7 @@ spawnpvech (int mode,
 #endif
 
   if (!(libcx_spawn2_loaded
-        || (currdir == NULL || strcmp (currdir, ".") == 0)))
+        || (currdir == NULL || streq (currdir, "."))))
     {
       errno = EINVAL;
       return -1;
@@ -219,7 +219,7 @@ spawnpvech (int mode,
           || dup2 (new_stderr, STDERR_FILENO) >= 0))
     {
       if (!libcx_spawn2_loaded
-          || (currdir == NULL || strcmp (currdir, ".") == 0))
+          || (currdir == NULL || streq (currdir, ".")))
         ret = spawnvpe (mode, progname, (char * const *) argv,
                         (char * const *) envp);
 #if HAVE_LIBCX_SPAWN2_H
index a17b631d029968f21a2d526bc4b2c6477901c84a..6c52cd2c4caaa33a6838f26c720396150acdaa0b 100644 (file)
@@ -88,8 +88,6 @@
 
 #define HOUR(x) (60 * 60 * (x))
 
-#define STREQ(a, b) (strcmp (a, b) == 0)
-
 /* Verify that time_t is an integer as POSIX requires, and that every
    time_t value fits in intmax_t.  Please file a bug report if these
    assumptions are false on your platform.  */
@@ -1312,17 +1310,17 @@ lookup_zone (parser_control const *pc, char const *name)
   table const *tp;
 
   for (tp = universal_time_zone_table; tp->name; tp++)
-    if (strcmp (name, tp->name) == 0)
+    if (streq (name, tp->name))
       return tp;
 
   /* Try local zone abbreviations before those in time_zone_table, as
      the local ones are more likely to be right.  */
   for (tp = pc->local_time_zone_table; tp->name; tp++)
-    if (strcmp (name, tp->name) == 0)
+    if (streq (name, tp->name))
       return tp;
 
   for (tp = time_zone_table; tp->name; tp++)
-    if (strcmp (name, tp->name) == 0)
+    if (streq (name, tp->name))
       return tp;
 
   return NULL;
@@ -1370,7 +1368,7 @@ lookup_word (parser_control const *pc, char *word)
     *p = c_toupper (to_uchar (*p));
 
   for (tp = meridian_table; tp->name; tp++)
-    if (strcmp (word, tp->name) == 0)
+    if (streq (word, tp->name))
       return tp;
 
   /* See if we have an abbreviation for a month.  */
@@ -1384,11 +1382,11 @@ lookup_word (parser_control const *pc, char *word)
   if ((tp = lookup_zone (pc, word)))
     return tp;
 
-  if (strcmp (word, dst_table[0].name) == 0)
+  if (streq (word, dst_table[0].name))
     return dst_table;
 
   for (tp = time_units_table; tp->name; tp++)
-    if (strcmp (word, tp->name) == 0)
+    if (streq (word, tp->name))
       return tp;
 
   /* Strip off any plural and try the units table again.  */
@@ -1396,13 +1394,13 @@ lookup_word (parser_control const *pc, char *word)
     {
       word[wordlen - 1] = '\0';
       for (tp = time_units_table; tp->name; tp++)
-        if (strcmp (word, tp->name) == 0)
+        if (streq (word, tp->name))
           return tp;
       word[wordlen - 1] = 'S';  /* For "this" in relative_time_table.  */
     }
 
   for (tp = relative_time_table; tp->name; tp++)
-    if (strcmp (word, tp->name) == 0)
+    if (streq (word, tp->name))
       return tp;
 
   /* Military time zones.  */
@@ -1879,8 +1877,8 @@ parse_datetime_body (struct timespec *result, char const *p,
           populate_local_time_zone_table (&pc, &probe_tm);
           if (pc.local_time_zone_table[1].name)
             {
-              if (! strcmp (pc.local_time_zone_table[0].name,
-                            pc.local_time_zone_table[1].name))
+              if (streq (pc.local_time_zone_table[0].name,
+                         pc.local_time_zone_table[1].name))
                 {
                   /* This locale uses the same abbreviation for standard and
                      daylight times.  So if we see that abbreviation, we don't
@@ -1919,7 +1917,7 @@ parse_datetime_body (struct timespec *result, char const *p,
         {
           if (tz != tzdefault)
             fprintf (stderr, _("TZ=\"%s\" in date string"), tzstring);
-          else if (STREQ (tzstring, "UTC0"))
+          else if (streq (tzstring, "UTC0"))
             {
               /* Special case: 'date -u' sets TZ="UTC0".  */
               fputs (_("TZ=\"UTC0\" environment value or -u"), stderr);
@@ -2324,7 +2322,7 @@ parse_datetime_body (struct timespec *result, char const *p,
       /* Special case: using 'date -u' simply set TZ=UTC0 */
       if (! tzstring)
         dbg_fputs (_("timezone: system default\n"));
-      else if (STREQ (tzstring, "UTC0"))
+      else if (streq (tzstring, "UTC0"))
         dbg_fputs (_("timezone: Universal Time\n"));
       else
         dbg_printf (_("timezone: TZ=\"%s\" environment value\n"), tzstring);
index d9d94a6cdcb1ab224a4d7c6a46bd0b24db172795..a8ed25db1c29f02f40fcd36a877a100a64dca5f5 100644 (file)
@@ -30,9 +30,9 @@ FILE *
 popen (const char *filename, const char *mode)
 {
   /* Use binary mode by default.  */
-  if (strcmp (mode, "r") == 0)
+  if (streq (mode, "r"))
     mode = "rb";
-  else if (strcmp (mode, "w") == 0)
+  else if (streq (mode, "w"))
     mode = "wb";
 
   return _popen (filename, mode);
index 715e750e7a46ff8b0bb946619e6106f212293a23..71d8c34ae579e79f4af4f062441efd81ff32d85b 100644 (file)
@@ -285,7 +285,7 @@ find_executable (const char *argv0)
     link = xreadlink ("/proc/curproc/file");
     if (link != NULL)
       {
-        if (strcmp (link, "unknown") != 0)
+        if (!streq (link, "unknown"))
           return link;
         free (link);
       }
index cb661348f261cc12f09b0791565d9f36d8896383..e927df21b3a5578c975ede8b71d33b8d2ec95e7f 100644 (file)
@@ -275,7 +275,7 @@ proper_name_utf8 (const char *name_ascii, const char *name_utf8)
   /* See whether we have a translation.  Some translators have not understood
      that they should use the UTF-8 form of the name, if possible.  So if the
      translator provided a no-op translation, we ignore it.  */
-  if (strcmp (translation, name_ascii) != 0)
+  if (!streq (translation, name_ascii))
     {
       /* See whether the translation contains the original name.  */
       if (mbsstr_trimmed_wordbounded (translation, name_ascii)
index 6e7b0c10d8edb9db4d9782837e02efe9b9b6593b..ec4ed905aef76a11200e819f5605af4dba3776a1 100644 (file)
@@ -85,7 +85,7 @@ main (int argc, char *argv[])
     }
 
   /* It would be possible to drop setuid/setgid privileges here.  But it is not
-     really needed, since the code below only calls strcmp and [f]printf.  */
+     really needed, since the code below only calls streq and [f]printf.  */
 
   {
     int do_help = 0;
@@ -98,14 +98,14 @@ main (int argc, char *argv[])
 
         if (arg[0] == '-')
           {
-            if (strcmp (arg, "--") == 0)
+            if (streq (arg, "--"))
               {
                 remaining++;
                 break;
               }
-            else if (strcmp (arg, "--help") == 0)
+            else if (streq (arg, "--help"))
               do_help = 1;
-            else if (strcmp (arg, "--version") == 0)
+            else if (streq (arg, "--version"))
               do_version = 1;
             else
               {
index acd49f7c53a53e78f0919709e60a7ccdefdbc5a5..c310ebda6590debdd6bb5cb47d87db7ae89e16fb 100644 (file)
@@ -106,7 +106,7 @@ putenv (char *string)
       name_x[name_end - string + 2] = 0;
       putenv_result = _putenv (name_x);
       for (ep = environ; *ep; ep++)
-        if (strcmp (*ep, name_x) == 0)
+        if (streq (*ep, name_x))
           {
             *ep = string;
             break;
index 282f4b2d2a50ce2ca1782344fb683753fcf77645..e86e15544f6b4a94f42bc040d4609ff1b3baad71 100644 (file)
@@ -50,9 +50,9 @@ is_attr_permissions (const char *name, struct error_context *ctx)
 {
   /* We need to explicitly test for the known extended attribute names,
      because at least on CentOS 7, attr_copy_action does not do it.  */
-  return strcmp (name, XATTR_NAME_POSIX_ACL_ACCESS) == 0
-         || strcmp (name, XATTR_NAME_POSIX_ACL_DEFAULT) == 0
-         || strcmp (name, XATTR_NAME_NFSV4_ACL) == 0
+  return streq (name, XATTR_NAME_POSIX_ACL_ACCESS)
+         || streq (name, XATTR_NAME_POSIX_ACL_DEFAULT)
+         || streq (name, XATTR_NAME_NFSV4_ACL)
          || attr_copy_action (name, ctx) == ATTR_ACTION_PERMISSIONS;
 }
 
index 1ddc4a51174a5bbbef19744d871c4dbef7c6407c..ce9aff9595555f438b95119af1463611b08ca46d 100644 (file)
@@ -343,7 +343,7 @@ read_utmp_from_file (char const *file, idx_t *n_entries, STRUCT_UTMP **utmp_buf,
   SET_UTMP_ENT ();
 
 #   if (defined __linux__ && !defined __ANDROID__) || defined __minix
-  bool file_is_utmp = (strcmp (file, UTMP_FILE) == 0);
+  bool file_is_utmp = streq (file, UTMP_FILE);
   /* Timestamp of the "runlevel" entry, if any.  */
   struct timespec runlevel_ts = {0};
 #   endif
@@ -457,7 +457,7 @@ read_utmp_from_file (char const *file, idx_t *n_entries, STRUCT_UTMP **utmp_buf,
      it produces wrong values after the date has been bumped in the running
      system.  */
   if ((options & (READ_UTMP_USER_PROCESS | READ_UTMP_NO_BOOT_TIME)) == 0
-      && strcmp (file, UTMP_FILE) == 0
+      && streq (file, UTMP_FILE)
       && !have_boot_time (a))
     {
       struct timespec boot_time;
@@ -556,7 +556,7 @@ read_utmp_from_file (char const *file, idx_t *n_entries, STRUCT_UTMP **utmp_buf,
     }
   else
     {
-      if (strcmp (file, UTMP_FILE) != 0)
+      if (!streq (file, UTMP_FILE))
         {
           int saved_errno = errno;
           free (a.utmp);
@@ -567,7 +567,7 @@ read_utmp_from_file (char const *file, idx_t *n_entries, STRUCT_UTMP **utmp_buf,
 
 #   if defined __OpenBSD__
   if ((options & (READ_UTMP_USER_PROCESS | READ_UTMP_NO_BOOT_TIME)) == 0
-      && strcmp (file, UTMP_FILE) == 0
+      && streq (file, UTMP_FILE)
       && !have_boot_time (a))
     {
       struct timespec boot_time;
@@ -585,7 +585,7 @@ read_utmp_from_file (char const *file, idx_t *n_entries, STRUCT_UTMP **utmp_buf,
 
 #  if defined __linux__ && !defined __ANDROID__
   if ((options & (READ_UTMP_USER_PROCESS | READ_UTMP_NO_BOOT_TIME)) == 0
-      && strcmp (file, UTMP_FILE) == 0
+      && streq (file, UTMP_FILE)
       && !have_boot_time (a))
     {
       struct timespec boot_time;
@@ -604,7 +604,7 @@ read_utmp_from_file (char const *file, idx_t *n_entries, STRUCT_UTMP **utmp_buf,
       && defined CTL_KERN && defined KERN_BOOTTIME \
       && !defined __minix
   if ((options & (READ_UTMP_USER_PROCESS | READ_UTMP_NO_BOOT_TIME)) == 0
-      && strcmp (file, UTMP_FILE) == 0
+      && streq (file, UTMP_FILE)
       && !have_boot_time (a))
     {
       struct timespec boot_time;
@@ -620,7 +620,7 @@ read_utmp_from_file (char const *file, idx_t *n_entries, STRUCT_UTMP **utmp_buf,
 
 #  if defined __HAIKU__
   if ((options & (READ_UTMP_USER_PROCESS | READ_UTMP_NO_BOOT_TIME)) == 0
-      && strcmp (file, UTMP_FILE) == 0
+      && streq (file, UTMP_FILE)
       && !have_boot_time (a))
     {
       struct timespec boot_time;
@@ -636,7 +636,7 @@ read_utmp_from_file (char const *file, idx_t *n_entries, STRUCT_UTMP **utmp_buf,
 
 #  if HAVE_OS_H /* BeOS, Haiku */
   if ((options & (READ_UTMP_USER_PROCESS | READ_UTMP_NO_BOOT_TIME)) == 0
-      && strcmp (file, UTMP_FILE) == 0
+      && streq (file, UTMP_FILE)
       && !have_boot_time (a))
     {
       struct timespec boot_time;
@@ -654,7 +654,7 @@ read_utmp_from_file (char const *file, idx_t *n_entries, STRUCT_UTMP **utmp_buf,
 
 # if defined __CYGWIN__ || defined _WIN32
   if ((options & (READ_UTMP_USER_PROCESS | READ_UTMP_NO_BOOT_TIME)) == 0
-      && strcmp (file, UTMP_FILE) == 0
+      && streq (file, UTMP_FILE)
       && !have_boot_time (a))
     {
       struct timespec boot_time;
@@ -670,7 +670,7 @@ read_utmp_from_file (char const *file, idx_t *n_entries, STRUCT_UTMP **utmp_buf,
 
 # if defined _WIN32 && ! defined __CYGWIN__
   if ((options & (READ_UTMP_USER_PROCESS | READ_UTMP_NO_BOOT_TIME)) == 0
-      && strcmp (file, UTMP_FILE) == 0
+      && streq (file, UTMP_FILE)
       && !have_boot_time (a))
     {
       struct timespec boot_time;
@@ -841,7 +841,7 @@ read_utmp_from_systemd (idx_t *n_entries, STRUCT_UTMP **utmp_buf, int options)
                   /* Try harder to get a sensible value for the tty.  */
                   if (sd_session_get_type (session, &type) < 0)
                     type = missing;
-                  if (strcmp (type, "tty") == 0)
+                  if (streq (type, "tty"))
                     {
                       char *service;
                       if (sd_session_get_service (session, &service) < 0)
@@ -863,7 +863,7 @@ read_utmp_from_systemd (idx_t *n_entries, STRUCT_UTMP **utmp_buf, int options)
                       else if (pty != NULL)
                         tty = pty;
                     }
-                  else if (strcmp (type, "web") == 0)
+                  else if (streq (type, "web"))
                     {
                       char *service;
                       if (sd_session_get_service (session, &service) < 0)
@@ -901,7 +901,7 @@ read_utmp_from_systemd (idx_t *n_entries, STRUCT_UTMP **utmp_buf, int options)
                          host field.  */
                       if (!type && sd_session_get_type (session, &type) < 0)
                         type = missing;
-                      if (strcmp (type, "x11") == 0)
+                      if (streq (type, "x11"))
                         {
                           char *display;
                           if (sd_session_get_display (session, &display) < 0)
@@ -978,7 +978,7 @@ read_utmp (char const *file, idx_t *n_entries, STRUCT_UTMP **utmp_buf,
            int options)
 {
 # if READUTMP_USE_SYSTEMD
-  if (strcmp (file, UTMP_FILE) == 0)
+  if (streq (file, UTMP_FILE))
     /* Imitate reading UTMP_FILE, using systemd and Linux APIs.  */
     return read_utmp_from_systemd (n_entries, utmp_buf, options);
 # endif
index febefb2a029fa396d34f15224097200783d3d94d..507707345ec55eae464b6eb9c449cec2ba60d8f0 100644 (file)
@@ -90,7 +90,7 @@ localized_pattern (const char *english_pattern, nl_item nl_index,
 static int
 try (const char *response, const char *pattern, char **lastp, regex_t *re)
 {
-  if (*lastp == NULL || strcmp (pattern, *lastp) != 0)
+  if (*lastp == NULL || !streq (pattern, *lastp))
     {
       char *safe_pattern;
 
index 771ffe15cf11ede9aa955f71f1f4fd57706e8694..caa1863329cb8aa9ba3da5844e80f750b637e583 100644 (file)
@@ -98,7 +98,7 @@ fill_lc_all_name (void)
 {
   bool all_same = true;
   for (size_t i = 1; i < 12; i++)
-    if (strcmp (lc_cat_name[i], lc_cat_name[0]) != 0)
+    if (!streq (lc_cat_name[i], lc_cat_name[0]))
       {
         all_same = false;
         break;
index ea8b4ba89be071bbc472798174567bf1d0712526..814a9bd8c73d588a7766c8aba7d63aea6c421148 100644 (file)
@@ -686,7 +686,7 @@ setlocale_unixlike (int category, const char *locale)
 
   /* The native Windows implementation of setlocale understands the special
      locale name "C", but not "POSIX".  Therefore map "POSIX" to "C".  */
-  if (locale != NULL && strcmp (locale, "POSIX") == 0)
+  if (locale != NULL && streq (locale, "POSIX"))
     locale = "C";
 
   /* The native Windows implementation of setlocale, in the UTF-8 environment,
@@ -694,8 +694,8 @@ setlocale_unixlike (int category, const char *locale)
      but it understands "English_United States.65001", which is functionally
      equivalent.  */
   if (locale != NULL
-      && ((is_utf8 && strcmp (locale, "C") == 0)
-          || strcmp (locale, "C.UTF-8") == 0))
+      && ((is_utf8 && streq (locale, "C"))
+          || streq (locale, "C.UTF-8")))
     locale = "English_United States.65001";
 
   /* First, try setlocale with the original argument unchanged.  */
@@ -728,7 +728,7 @@ setlocale_unixlike (int category, const char *locale)
       /* llCC_buf now contains
            language[_territory][@modifier]
        */
-      if (strcmp (llCC_buf, locale) != 0)
+      if (!streq (llCC_buf, locale))
         {
           if (is_utf8)
             {
@@ -890,7 +890,7 @@ setlocale_unixlike (int category, const char *locale)
       case LC_TELEPHONE:
       case LC_MEASUREMENT:
         if (locale == NULL
-            || strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0)
+            || streq (locale, "C") || streq (locale, "POSIX"))
           result = (char *) "C";
         break;
       default:
@@ -1501,7 +1501,7 @@ setlocale_improved (int category, const char *locale)
              LC_CTYPE category to an invalid value ("C") when it does not
              support the specified encoding.  Report a failure instead.  */
           if (strchr (base_name, '.') != NULL
-              && strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+              && streq (setlocale (LC_CTYPE, NULL), "C"))
             goto fail;
 #  endif
 
@@ -1516,7 +1516,7 @@ setlocale_improved (int category, const char *locale)
 
               /* If name is the same as base_name, it has already been set
                  through the setlocale call before the loop.  */
-              if (strcmp (name, base_name) != 0
+              if (!streq (name, base_name)
 #  if LC_MESSAGES == 1729
                   || cat == LC_MESSAGES
 #  endif
@@ -1726,7 +1726,7 @@ setlocale_improved (int category, const char *locale)
                      set the LC_CTYPE category to an invalid value ("C") when
                      it does not support the specified encoding.  Report a
                      failure instead.  */
-                  if (strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+                  if (streq (setlocale (LC_CTYPE, NULL), "C"))
                     {
                       /* Don't risk an endless recursion.  */
                       if (saved_locale[0] != '\0')
@@ -1778,7 +1778,7 @@ setlocale_improved (int category, const char *locale)
   {
     char *name1 = setlocale (LC_ALL, NULL);
     char *name2 = setlocale_single (LC_MESSAGES, NULL);
-    if (strcmp (name1, name2) == 0)
+    if (streq (name1, name2))
       /* Not a mixed locale.  */
       return name1;
     else
index e8c830c6daf28cfac2348abfb2848ac4d3334b1f..bf4d009578d87cbebfa6a9111a393aae0f8ea778 100644 (file)
@@ -288,7 +288,7 @@ str2signum (char const *signame)
     {
       unsigned int i;
       for (i = 0; i < NUMNAME_ENTRIES; i++)
-        if (strcmp (numname_table[i].name, signame) == 0)
+        if (streq (numname_table[i].name, signame))
           return numname_table[i].num;
 
       {
index f6558dfd16e4d654545d14469ca5b461c11bad7e..34c16445fc5ff810da336a77be34b1a7eea2a3fb 100644 (file)
@@ -328,7 +328,7 @@ static HANDLE
 open_handle (const char *name, int flags, mode_t mode)
 {
   /* To ease portability.  Like in open.c.  */
-  if (strcmp (name, "/dev/null") == 0)
+  if (streq (name, "/dev/null"))
     name = "NUL";
 
   /* POSIX <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>
index 9c44ba43b4ee165d1f95bd7fad887e5bb264e4ad..f4cc02e9d74b3bbc81f3d77deb0b428507ebcec9 100644 (file)
@@ -112,7 +112,7 @@ rpl_stat (char const *name, struct stat *buf)
      <https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file> ?  */
 
   /* To ease portability.  Like in open.c.  */
-  if (strcmp (name, "/dev/null") == 0)
+  if (streq (name, "/dev/null"))
     name = "NUL";
 
   /* POSIX <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>
index d79d710866e5dab93b4fc52975350478bb4eb227..cd2cc9e1469606283d32a71b29b5e0ddf7b44de3 100644 (file)
@@ -27,5 +27,5 @@ str_endswith (const char *string, const char *suffix)
 {
   size_t len = strlen (string);
   size_t n = strlen (suffix);
-  return len >= n && strcmp (string + len - n, suffix) == 0;
+  return len >= n && streq (string + len - n, suffix);
 }
index 1f1ff38f6bdf7a8f1ed13b31dcb3d4c07f5428f6..eb0df460e5b63671292848ebdc6b7b8a03e47445 100644 (file)
@@ -39,7 +39,7 @@ extern "C" {
 static inline int
 streq9 (const char *s1, const char *s2)
 {
-  return strcmp (s1 + 9, s2 + 9) == 0;
+  return streq (s1 + 9, s2 + 9);
 }
 
 static inline int
index 26448250c1bd93b7e5d4f2d2eedf207b7c5c2c07..b7dec0178b3861842f138314ee1f05000f249dc7 100644 (file)
@@ -160,7 +160,7 @@ mem_iconveha_notranslit (const char *src, size_t srclen,
       /* Unsupported from_codeset or to_codeset. Check whether the caller
          requested autodetection.  */
       for (alias = autodetect_list; alias != NULL; alias = alias->next)
-        if (strcmp (from_codeset, alias->name) == 0)
+        if (streq (from_codeset, alias->name))
           {
             const char * const *encodings;
 
@@ -270,7 +270,7 @@ str_iconveha_notranslit (const char *src,
       /* Unsupported from_codeset or to_codeset. Check whether the caller
          requested autodetection.  */
       for (alias = autodetect_list; alias != NULL; alias = alias->next)
-        if (strcmp (from_codeset, alias->name) == 0)
+        if (streq (from_codeset, alias->name))
           {
             const char * const *encodings;
 
index 7bc77d1cc90d2c07dd9617ecef05ba095e34f0a6..00446f6eb84a8b59eba5341037d4a8a0daf23739 100644 (file)
@@ -84,7 +84,7 @@ struniq (const char *string)
   struct struniq_hash_node *new_node;
   struct struniq_hash_node *p;
   for (p = struniq_hash_table[slot]; p != NULL; p = p->next)
-    if (strcmp (p->contents, string) == 0)
+    if (streq (p->contents, string))
       return p->contents;
   size = strlen (string) + 1;
   new_node =
@@ -101,7 +101,7 @@ struniq (const char *string)
     /* Check whether another thread already added the string while we were
        waiting on the lock.  */
     for (p = struniq_hash_table[slot]; p != NULL; p = p->next)
-      if (strcmp (p->contents, string) == 0)
+      if (streq (p->contents, string))
         {
           free (new_node);
           new_node = p;
index 10691eb1830231044a76eb4fecbdf9010dc4bebf..49206d746b039705a3a0aeff922fd1c1e0212a64 100644 (file)
@@ -97,7 +97,7 @@ open_supersede (const char *filename, int flags, mode_t mode,
     #endif
 
 #if defined _WIN32 && ! defined __CYGWIN__
-  if (strcmp (filename, "/dev/null") == 0)
+  if (streq (filename, "/dev/null"))
     filename = "NUL";
 #endif
 
index 125f4e272d2ea850225ec2ec52f7fa29825d159f..3a4336636fdc26e07568fbaf146b6b7990925271 100644 (file)
@@ -116,7 +116,7 @@ save_abbr (timezone_t tz, struct tm *tm)
     {
       zone_copy = tz->abbrs;
 
-      while (strcmp (zone_copy, zone) != 0)
+      while (!streq (zone_copy, zone))
         {
           if (! (*zone_copy || (zone_copy == tz->abbrs && tz->tz_is_set)))
             {
@@ -202,7 +202,7 @@ set_tz (timezone_t tz)
 {
   char *env_tz = getenv_TZ ();
   if (env_tz
-      ? tz->tz_is_set && strcmp (tz->abbrs, env_tz) == 0
+      ? tz->tz_is_set && streq (tz->abbrs, env_tz)
       : !tz->tz_is_set)
     return local_tz;
   else
index 6305cbbc420a9d33d6749c557eb5b9c31b3ccaa0..5c67283a27c09f9ea22c2a2047268aa117347935 100644 (file)
@@ -81,7 +81,7 @@ unicode_to_mb (unsigned int code,
     {
       const char *charset = locale_charset ();
 
-      is_utf8 = !strcmp (charset, UTF8_NAME);
+      is_utf8 = streq (charset, UTF8_NAME);
 #if HAVE_ICONV
       if (!is_utf8)
         {
index 7219c741cd453536b56486b110812817c45a7a08..614da3187c36cf70a0587579082f0aa7c2bbae1b 100644 (file)
@@ -439,7 +439,7 @@ thousands_separator_char (char stackbuf[10])
   stackbuf[strlen (stackbuf) - 3] = '\0';
 #   if defined __sun
   /* Solaris specific hack: Replace wrong result (0xC2 means U+00A0).  */
-  if (strcmp (&stackbuf[1], "\302") == 0)
+  if (streq (&stackbuf[1], "\302"))
     strcpy (&stackbuf[1], MB_CUR_MAX > 1 ? "\302\240" : "\240");
 #   endif
   return &stackbuf[1];
@@ -524,7 +524,7 @@ thousands_separator_wchar (wchar_t stackbuf[10])
   /* Now tmp = L"1<thousep>000".  */
   tmp[strlen (tmp) - 3] = '\0';
   /* Solaris specific hack: Replace wrong result (0xC2 means U+00A0).  */
-  if (strcmp (&tmp[1], "\302") == 0)
+  if (streq (&tmp[1], "\302"))
     strcpy (&tmp[1], MB_CUR_MAX > 1 ? "\302\240" : "\240");
   if (tmp[1] != '\0')
     {
index 1351fd7ec33931cb7316de072c983bdba573ccad..5db654fbcc342c0d01aacf1a1658cb521bce76b1 100644 (file)
@@ -381,9 +381,9 @@ abs_git_checkout (void)
 static long
 ancestor_level (const char *dir1, const char *dir2)
 {
-  if (strcmp (dir1, "/") == 0)
+  if (streq (dir1, "/"))
     dir1 = "";
-  if (strcmp (dir2, "/") == 0)
+  if (streq (dir2, "/"))
     dir2 = "";
   size_t dir1_len = strlen (dir1);
   if (strncmp (dir1, dir2, dir1_len) == 0)
@@ -415,14 +415,14 @@ static char *
 relativize (const char *filename,
             unsigned long n, const char *dir1, const char *dir2)
 {
-  if (strcmp (dir1, "/") == 0)
+  if (streq (dir1, "/"))
     dir1 = "";
   size_t dir1_len = strlen (dir1);
   if (!(strncmp (filename, dir1, dir1_len) == 0
         && (filename[dir1_len] == '\0' || ISSLASH (filename[dir1_len]))))
     /* Invalid argument.  */
     abort ();
-  if (strcmp (dir2, "/") == 0)
+  if (streq (dir2, "/"))
     dir2 = "";
 
   dir2 += dir1_len;
@@ -560,7 +560,7 @@ max_vc_mtime (struct timespec *max_of_mtimes,
                   /* Test which of these absolute file names are outside of the
                      git_checkout.  */
                   char *git_checkout_slash =
-                    (strcmp (git_checkout, "/") == 0
+                    (streq (git_checkout, "/")
                      ? xstrdup (git_checkout)
                      : xasprintf ("%s%c", git_checkout, SLASH));
 
@@ -1002,75 +1002,75 @@ test_ancestor_level (void)
 static void
 test_relativize (void)
 {
-  assert (strcmp (relativize ("/home/user/projects/gnulib",
-                              0, "/home/user/projects/gnulib", "/home/user/projects/gnulib"),
-                  ".") == 0);
-  assert (strcmp (relativize ("/home/user/projects/gnulib/NEWS",
-                              0, "/home/user/projects/gnulib", "/home/user/projects/gnulib"),
-                  "NEWS") == 0);
-  assert (strcmp (relativize ("/home/user/projects/gnulib/doc/Makefile",
-                              0, "/home/user/projects/gnulib", "/home/user/projects/gnulib"),
-                  "doc/Makefile") == 0);
-
-  assert (strcmp (relativize ("/",
-                              0, "/", "/"),
-                  ".") == 0);
-  assert (strcmp (relativize ("/swapfile",
-                              0, "/", "/"),
-                  "swapfile") == 0);
-  assert (strcmp (relativize ("/etc/passwd",
-                              0, "/", "/"),
-                  "etc/passwd") == 0);
-
-  assert (strcmp (relativize ("/home/user/projects/gnulib",
-                              2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
-                  "../../") == 0);
-  assert (strcmp (relativize ("/home/user/projects/gnulib/lib",
-                              2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
-                  "../") == 0);
-  assert (strcmp (relativize ("/home/user/projects/gnulib/lib/crypto",
-                              2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
-                  ".") == 0);
-  assert (strcmp (relativize ("/home/user/projects/gnulib/lib/malloc",
-                              2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
-                  "../malloc") == 0);
-  assert (strcmp (relativize ("/home/user/projects/gnulib/lib/cr",
-                              2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
-                  "../cr") == 0);
-  assert (strcmp (relativize ("/home/user/projects/gnulib/lib/cryptography",
-                              2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
-                  "../cryptography") == 0);
-  assert (strcmp (relativize ("/home/user/projects/gnulib/doc",
-                              2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
-                  "../../doc") == 0);
-  assert (strcmp (relativize ("/home/user/projects/gnulib/doc/Makefile",
-                              2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
-                  "../../doc/Makefile") == 0);
-
-  assert (strcmp (relativize ("/",
-                              2, "/", "/home/user"),
-                  "../../") == 0);
-  assert (strcmp (relativize ("/home",
-                              2, "/", "/home/user"),
-                  "../") == 0);
-  assert (strcmp (relativize ("/home/user",
-                              2, "/", "/home/user"),
-                  ".") == 0);
-  assert (strcmp (relativize ("/home/root",
-                              2, "/", "/home/user"),
-                  "../root") == 0);
-  assert (strcmp (relativize ("/home/us",
-                              2, "/", "/home/user"),
-                  "../us") == 0);
-  assert (strcmp (relativize ("/home/users",
-                              2, "/", "/home/user"),
-                  "../users") == 0);
-  assert (strcmp (relativize ("/etc",
-                              2, "/", "/home/user"),
-                  "../../etc") == 0);
-  assert (strcmp (relativize ("/etc/passwd",
-                              2, "/", "/home/user"),
-                  "../../etc/passwd") == 0);
+  assert (streq (relativize ("/home/user/projects/gnulib",
+                             0, "/home/user/projects/gnulib", "/home/user/projects/gnulib"),
+                 "."));
+  assert (streq (relativize ("/home/user/projects/gnulib/NEWS",
+                             0, "/home/user/projects/gnulib", "/home/user/projects/gnulib"),
+                 "NEWS"));
+  assert (streq (relativize ("/home/user/projects/gnulib/doc/Makefile",
+                             0, "/home/user/projects/gnulib", "/home/user/projects/gnulib"),
+                 "doc/Makefile"));
+
+  assert (streq (relativize ("/",
+                             0, "/", "/"),
+                 "."));
+  assert (streq (relativize ("/swapfile",
+                             0, "/", "/"),
+                 "swapfile"));
+  assert (streq (relativize ("/etc/passwd",
+                             0, "/", "/"),
+                 "etc/passwd"));
+
+  assert (streq (relativize ("/home/user/projects/gnulib",
+                             2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
+                 "../../"));
+  assert (streq (relativize ("/home/user/projects/gnulib/lib",
+                             2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
+                 "../"));
+  assert (streq (relativize ("/home/user/projects/gnulib/lib/crypto",
+                             2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
+                 "."));
+  assert (streq (relativize ("/home/user/projects/gnulib/lib/malloc",
+                             2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
+                 "../malloc"));
+  assert (streq (relativize ("/home/user/projects/gnulib/lib/cr",
+                             2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
+                 "../cr"));
+  assert (streq (relativize ("/home/user/projects/gnulib/lib/cryptography",
+                             2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
+                 "../cryptography"));
+  assert (streq (relativize ("/home/user/projects/gnulib/doc",
+                             2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
+                 "../../doc"));
+  assert (streq (relativize ("/home/user/projects/gnulib/doc/Makefile",
+                             2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
+                 "../../doc/Makefile"));
+
+  assert (streq (relativize ("/",
+                             2, "/", "/home/user"),
+                 "../../"));
+  assert (streq (relativize ("/home",
+                             2, "/", "/home/user"),
+                 "../"));
+  assert (streq (relativize ("/home/user",
+                             2, "/", "/home/user"),
+                 "."));
+  assert (streq (relativize ("/home/root",
+                             2, "/", "/home/user"),
+                 "../root"));
+  assert (streq (relativize ("/home/us",
+                             2, "/", "/home/user"),
+                 "../us"));
+  assert (streq (relativize ("/home/users",
+                             2, "/", "/home/user"),
+                 "../users"));
+  assert (streq (relativize ("/etc",
+                             2, "/", "/home/user"),
+                 "../../etc"));
+  assert (streq (relativize ("/etc/passwd",
+                             2, "/", "/home/user"),
+                 "../../etc/passwd"));
 }
 
 /* Usage: ./a.out FILE[...]
index 0d1bc5de99f160697791c122c88b1326836acdbd..0c45caad397c2ca1fbaaa2e6e9fb0f2c4dc6d4ba 100644 (file)
@@ -23,11 +23,11 @@ wctrans (const char *name)
     switch (name[2])
       {
       case 'l':
-        if (strcmp (name + 3, "ower") == 0)
+        if (streq (name + 3, "ower"))
           return (wctrans_t) towlower;
         break;
       case 'u':
-        if (strcmp (name + 3, "pper") == 0)
+        if (streq (name + 3, "pper"))
           return (wctrans_t) towupper;
         break;
       default:
index 8bb83be71ba3ebee3eaa6fbaf1445ebf13ce82e8..dad3fa1106bcd5884ebbc4be4dfdc9d035114328 100644 (file)
@@ -27,11 +27,11 @@ wctype (const char* name)
           switch (name[2])
             {
             case 'n':
-              if (strcmp (name + 3, "um") == 0)
+              if (streq (name + 3, "um"))
                 return (wctype_t) iswalnum;
               break;
             case 'p':
-              if (strcmp (name + 3, "ha") == 0)
+              if (streq (name + 3, "ha"))
                 return (wctype_t) iswalpha;
               break;
             default:
@@ -43,34 +43,34 @@ wctype (const char* name)
         }
       break;
     case 'b':
-      if (strcmp (name + 1, "lank") == 0)
+      if (streq (name + 1, "lank"))
         return (wctype_t) iswblank;
       break;
     case 'c':
-      if (strcmp (name + 1, "ntrl") == 0)
+      if (streq (name + 1, "ntrl"))
         return (wctype_t) iswcntrl;
       break;
     case 'd':
-      if (strcmp (name + 1, "igit") == 0)
+      if (streq (name + 1, "igit"))
         return (wctype_t) iswdigit;
       break;
     case 'g':
-      if (strcmp (name + 1, "raph") == 0)
+      if (streq (name + 1, "raph"))
         return (wctype_t) iswgraph;
       break;
     case 'l':
-      if (strcmp (name + 1, "ower") == 0)
+      if (streq (name + 1, "ower"))
         return (wctype_t) iswlower;
       break;
     case 'p':
       switch (name[1])
         {
         case 'r':
-          if (strcmp (name + 2, "int") == 0)
+          if (streq (name + 2, "int"))
             return (wctype_t) iswprint;
           break;
         case 'u':
-          if (strcmp (name + 2, "nct") == 0)
+          if (streq (name + 2, "nct"))
             return (wctype_t) iswpunct;
           break;
         default:
@@ -78,15 +78,15 @@ wctype (const char* name)
         }
       break;
     case 's':
-      if (strcmp (name + 1, "pace") == 0)
+      if (streq (name + 1, "pace"))
         return (wctype_t) iswspace;
       break;
     case 'u':
-      if (strcmp (name + 1, "pper") == 0)
+      if (streq (name + 1, "pper"))
         return (wctype_t) iswupper;
       break;
     case 'x':
-      if (strcmp (name + 1, "digit") == 0)
+      if (streq (name + 1, "digit"))
         return (wctype_t) iswxdigit;
       break;
     default:
index bcd1fc5e40e597eb167ef7d5f674f63a90ce163f..d86c50e91a45491e6082f3d80c767ba1c58a8372 100644 (file)
@@ -16,6 +16,7 @@ extern-inline
 fstat
 minmax
 stat
+stringeq
 bool
 sys_stat-h
 stdint-h
index d6122adcef97444b1e389d2eb935fcf77512acec..d435ae0cfdf0129771aaabdc9f53f5075dd4becc 100644 (file)
@@ -24,6 +24,7 @@ basename-lgpl
 extern-inline
 getopt-gnu
 strchrnul
+stringeq
 sysexits-h
 malloc-gnu
 mempcpy
index de2a3b63deee362319af3704a611581ed83ca02d..1545c5e22d99d8ae0766731d5d24303ecd3d5fbe 100644 (file)
@@ -10,6 +10,7 @@ uchar-h
 wctrans
 c32tolower
 c32toupper
+stringeq
 
 configure.ac:
 gl_UCHAR_MODULE_INDICATOR([c32_get_mapping])
index e511bd51c769b2bf7a14bd6bb868573ce3b0c1af..e26a894df0070b632630cbd1db7d5f087c6ec217 100644 (file)
@@ -20,6 +20,7 @@ c32ispunct
 c32isspace
 c32isupper
 c32isxdigit
+stringeq
 
 configure.ac:
 gl_UCHAR_MODULE_INDICATOR([c32_get_type_test])
index 9e86b793bfbaf3671b96ee1a00f1b8c45909f793..51e55a7465bad3e8eda76706cfa1c4caccea3ca4 100644 (file)
@@ -10,6 +10,7 @@ Depends-on:
 filename
 malloc-posix
 stpcpy
+stringeq
 
 configure.ac:
 
index 448eb2a9028306b20b4f44860954bf07258c28f6..8f5871d46f1d24a7528b000b62f0df4a24e54f8f 100644 (file)
@@ -9,6 +9,7 @@ Depends-on:
 attribute
 bool
 c99
+stringeq
 
 configure.ac:
 AC_REQUIRE([AC_C_INLINE])
index eed35091b82bafb2d4642e17cfef8ca6c52b0b16..8aa8465c5a5fd36dd8b9d345f31366bd68014143 100644 (file)
@@ -31,6 +31,7 @@ stdint-h
 stdio-h
 stdlib-h
 string-h
+stringeq
 uchar-h
 # The lonesome_lower array requires ISO C 23 semantics for char32_t.
 # But uchar-h-c23 has a global effect, therefore leave it to each package
index e4fce0ed04daf35ca6ee72a8e778ddf0b8daf250..46e1ab0d6380d4b3d257246c1d65a2a637a8fb94 100644 (file)
@@ -10,6 +10,7 @@ locale-h
 freelocale      [test $HAVE_LOCALE_T = 0 || { test $HAVE_DUPLOCALE = 1 && test $REPLACE_DUPLOCALE = 1; }]
 newlocale       [test $HAVE_LOCALE_T = 0 || { test $HAVE_DUPLOCALE = 1 && test $REPLACE_DUPLOCALE = 1; }]
 setlocale-null  [test $HAVE_LOCALE_T = 0 || { test $HAVE_DUPLOCALE = 1 && test $REPLACE_DUPLOCALE = 1; }]
+stringeq        [test $HAVE_LOCALE_T = 0 || { test $HAVE_DUPLOCALE = 1 && test $REPLACE_DUPLOCALE = 1; }]
 
 configure.ac:
 gl_FUNC_DUPLOCALE
index d3ccc5be518db83e3133296395926c775079dc44..a4701ebf1277a04d4e94396bfeb7cc0ad4d8f9e6 100644 (file)
@@ -17,6 +17,7 @@ mbscasecmp
 mbuiter               [test "$GNULIB_MCEL_PREFER" != yes]
 nullptr
 regex
+stringeq
 bool
 unlocked-io-internal
 xalloc
index 619f089407a9400234d988ea7390b45cc33082c0..782ba981a6afadd15b0e2fbc22680bbf341184e6 100644 (file)
@@ -14,6 +14,7 @@ xalloc
 xconcat-filename
 access
 stat
+stringeq
 unistd-h
 
 configure.ac:
index 6f279f0f50e7f69207e98858759528bbdb6632ef..c36295f8afab7b1d91f9879537d53249ebd97ba3 100644 (file)
@@ -15,6 +15,7 @@ concat-filename
 access
 stat
 strdup-posix
+stringeq
 malloc-posix
 unistd-h
 
index 4580b374a0af6e73d0082d578567b68e63269dea..422759e6220824336514f7db045ffd724a729030 100644 (file)
@@ -12,6 +12,7 @@ stdio-h
 largefile
 fcntl-h         [test $REPLACE_FOPEN = 1]
 bool            [test $REPLACE_FOPEN = 1]
+stringeq        [test $REPLACE_FOPEN = 1]
 unistd-h        [test $REPLACE_FOPEN = 1]
 close           [test $REPLACE_FOPEN = 1]
 fstat           [test $REPLACE_FOPEN = 1]
index e6d20ed57fe5039797902061e537ea2677816a8e..1433f514a073ae8c2210933a802af15f9b24424b 100644 (file)
@@ -9,6 +9,7 @@ fopen
 open            [test $REPLACE_FOPEN_FOR_FOPEN_GNU = 1]
 fcntl-h         [test $REPLACE_FOPEN_FOR_FOPEN_GNU = 1]
 bool            [test $REPLACE_FOPEN_FOR_FOPEN_GNU = 1]
+stringeq        [test $REPLACE_FOPEN_FOR_FOPEN_GNU = 1]
 unistd-h        [test $REPLACE_FOPEN_FOR_FOPEN_GNU = 1]
 close           [test $REPLACE_FOPEN_FOR_FOPEN_GNU = 1]
 fstat           [test $REPLACE_FOPEN_FOR_FOPEN_GNU = 1]
index 6bf857bb9c228e684f28a21cd882683469edb8dc..19d41a440b0c8f4198dc762cc54f73d383f21257 100644 (file)
@@ -7,6 +7,7 @@ m4/freopen.m4
 
 Depends-on:
 fcntl-h        [test $REPLACE_FREOPEN = 1]
+stringeq       [test $REPLACE_FREOPEN = 1]
 open           [test $REPLACE_FREOPEN = 1]
 stdio-h
 largefile
index ac6be2cb32ec2cd9af790298080c21ff909e4d1b..70e3c1bdc2db68ff3a370beecd02976801b8e875 100644 (file)
@@ -40,6 +40,7 @@ realloc-posix
 bool
 stddef-h
 stdint-h
+stringeq
 
 configure.ac:
 gl_FUNC_FTS
index 6b9cc9e9baca1607be0540518212e93590e18049..febf2911da232f02ddbc3044e55621b32ac68d0a 100644 (file)
@@ -12,6 +12,7 @@ extensions
 getlocalename_l-unsafe [test $HAVE_GETLOCALENAME_L = 0 || test $REPLACE_GETLOCALENAME_L = 1]
 flexmember             [test $HAVE_GETLOCALENAME_L = 0 || test $REPLACE_GETLOCALENAME_L = 1]
 lock                   [test $HAVE_GETLOCALENAME_L = 0 || test $REPLACE_GETLOCALENAME_L = 1]
+stringeq               [test $HAVE_GETLOCALENAME_L = 0 || test $REPLACE_GETLOCALENAME_L = 1]
 bool                   [test $HAVE_GETLOCALENAME_L = 0 || test $REPLACE_GETLOCALENAME_L = 1]
 thread-optim           [test $HAVE_GETLOCALENAME_L = 0 || test $REPLACE_GETLOCALENAME_L = 1]
 
index c2392fc39d87f0a1d83d4e4e6f80e648b08c1817..82bff7746f30d7b1a4d598f816f05a2828afedd8 100644 (file)
@@ -15,6 +15,7 @@ locale-h
 getlocalename_l-unsafe-limited
 flexmember
 lock
+stringeq
 bool
 thread-optim
 setlocale-fixes
index 64f3e4fd25f72475b92858d77fdc42f11ce17051..6781219afe28f7df1330b727121dd05bcb889668 100644 (file)
@@ -8,6 +8,7 @@ m4/getlogin.m4
 Depends-on:
 unistd-h
 readutmp        [test $HAVE_GETLOGIN = 0 || test $REPLACE_GETLOGIN = 1]
+stringeq        [test $HAVE_GETLOGIN = 0 || test $REPLACE_GETLOGIN = 1]
 
 configure.ac:
 gl_FUNC_GETLOGIN
index ee27691bcb2aa8cd49045c7870db8327c746ab6d..756df53033827ab01159dd8e5942ab5d7c773b1f 100644 (file)
@@ -8,6 +8,7 @@ m4/getugroups.m4
 
 Depends-on:
 errno-h
+stringeq
 
 configure.ac:
 gl_GETUGROUPS
index af94813fd25bebbfccaae6ec3d9215ac10cf71e1..11e0265b2e879ffa1c09d30a9ec775dd7a95e3a0 100644 (file)
@@ -8,6 +8,7 @@ lib/hard-locale.c
 Depends-on:
 bool
 setlocale-null
+stringeq
 
 configure.ac:
 AC_REQUIRE([gl_FUNC_SETLOCALE_NULL])
index 7e5eebf76314a16cff1440edb9bcfcb36f976c7e..bda7905659197b6a8ca7c42e77e8beb989223065 100644 (file)
@@ -9,6 +9,7 @@ lib/hash-triple.h
 Depends-on:
 hashcode-string2
 same-inode
+stringeq
 bool
 
 configure.ac:
index 8391b4576b09b69b3c8e0c84521e80c7305f232a..aa32fc9a0749fbb78ec9ac1892db71e9fbacb6bf 100644 (file)
@@ -7,6 +7,7 @@ lib/hashkey-string.c
 
 Depends-on:
 bool
+stringeq
 
 configure.ac:
 
index 2ac5252a1caa139e158d9695c0b1b46bfd4e1474..eb7dfeef403b1899a5da4d912e20dce4b4a512e7 100644 (file)
@@ -18,6 +18,7 @@ iconv
 c-ctype           [test $REPLACE_ICONV_OPEN = 1]
 c-strcasecmp      [test $REPLACE_ICONV_OPEN = 1]
 stdint-h          [test $REPLACE_ICONV_UTF = 1]
+stringeq          [test $REPLACE_ICONV_UTF = 1]
 unistr/u8-mbtoucr [test $REPLACE_ICONV_UTF = 1]
 unistr/u8-uctomb  [test $REPLACE_ICONV_UTF = 1]
 
index 25cfb3fe8db5158c93de75f859b8bfb784868330..34c19e046ff5cc35538edc7e5b40fca83605f73c 100644 (file)
@@ -8,6 +8,7 @@ m4/idcache.m4
 
 Depends-on:
 flexmember
+stringeq
 xalloc
 
 configure.ac:
index 65ab529e95bf6ba2383c1b33fe4655073affe29f..0e5be1d035b212a02b8af134bb6264f8688dd5c9 100644 (file)
@@ -9,6 +9,7 @@ m4/localcharset.m4
 
 Depends-on:
 extensions
+stringeq
 
 configure.ac:
 gl_LOCALCHARSET
index 15d1dea1624e1f164f0bb21212845da91b9f15f1..9a10ce44ea035b6730fcf8883da84dc1d48ee339 100644 (file)
@@ -11,6 +11,7 @@ locale-h
 localename-unsafe
 flexmember
 lock
+stringeq
 bool
 thread-optim
 
index 01901ab1f6bf9676ae72b156670f7fe64fd2fda8..37d225a74b6d9d9e6ff34c9edbb0629b7d28fe8c 100644 (file)
@@ -17,6 +17,7 @@ localename-environ
 extensions
 locale-h
 strdup
+stringeq
 windows-mutex
 getlocalename_l-unsafe
 setlocale-null-unlocked
index 73ef26c1f5c8f07f91b650e443fd43fa149074c8..9aeecb2873a0c1586cc6bfb6b88d2223ba738792 100644 (file)
@@ -8,6 +8,7 @@ Depends-on:
 string-h
 bool
 str_endswith
+stringeq
 mbslen
 mbiter
 
index 9658435562b5a40b1602e9fcd26f88e5e6499091..4cf5563608bd25695d3a2cd5ac7770d99180cc6b 100644 (file)
@@ -16,6 +16,7 @@ open
 unlocked-io-internal
 bool
 stdint-h
+stringeq
 strstr-simple
 xalloc
 
index c48ff2b8cd212d4d77f644b1b7b24c85ad4ee681..0bff3d37943de9c87d2e9dd18d7418fa46c7cd78 100644 (file)
@@ -8,6 +8,7 @@ m4/newlocale.m4
 Depends-on:
 locale-h
 localename-environ
+stringeq
 
 configure.ac:
 gl_FUNC_NEWLOCALE
index b553cfb99b72388661c8adab16b3e97ecf85e566..0d8e968821089c4a8ff4f02c26ec662dd6b08ea3 100644 (file)
@@ -13,6 +13,7 @@ Depends-on:
 langinfo-h
 localeconv      [test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1]
 setlocale-null  [test $HAVE_NL_LANGINFO = 0 || test $HAVE_LANGINFO_CODESET = 0]
+stringeq        [test $HAVE_NL_LANGINFO = 0 || test $HAVE_LANGINFO_CODESET = 0]
 
 configure.ac:
 gl_FUNC_NL_LANGINFO
index 1081f7b778abd55d805bbd320a46ab81f184e417..ac56d1dd0f4c4427a0964571ab9244d2f1e25b3c 100644 (file)
@@ -10,6 +10,7 @@ Depends-on:
 c-ctype
 extensions
 minmax
+stringeq
 unistd-h
 
 configure.ac:
index 62b711f6814ef29f094a6d4da46b0a8b8f9311bd..6eec9e29f6478a5314c22665674b53c25081067b 100644 (file)
@@ -15,6 +15,7 @@ cloexec         [test $REPLACE_OPEN = 1]
 fstat           [test $REPLACE_OPEN = 1]
 lstat           [test $REPLACE_OPEN = 1]
 stat            [test $REPLACE_OPEN = 1]
+stringeq        [test $REPLACE_OPEN = 1]
 
 configure.ac:
 gl_FUNC_OPEN
index b8b3e6d75b65520ae20ee0cf76b33125af9682b4..f64d63007bf9e6128f011261a59eb4177cd4e839 100644 (file)
@@ -22,6 +22,7 @@ intprops
 inttypes-h
 mktime
 stdckdint-h
+stringeq
 time-h
 time_r
 time_rz
index 494081105e3f2d6dca5a11672d11b3f7dca1c617..903b9d8c0f395a182a4de960379ad8bb56bd9765 100644 (file)
@@ -8,6 +8,7 @@ m4/popen.m4
 Depends-on:
 stdio-h
 open            [test $HAVE_POPEN = 0 || test $REPLACE_POPEN = 1]
+stringeq        [test $HAVE_POPEN = 0 || test $REPLACE_POPEN = 1]
 
 configure.ac:
 gl_FUNC_POPEN
index 8b5439e87bc9c660b93b3f65aa28b253388129c1..008d22c9034e7d97cc6a1ebf698d4882eee26b15 100644 (file)
@@ -20,6 +20,7 @@ concat-filename [test $HAVE_POSIX_SPAWN = 0]
 findprog-in     [test $HAVE_POSIX_SPAWN = 0]
 free-posix      [test $HAVE_POSIX_SPAWN = 0]
 malloca         [test $HAVE_POSIX_SPAWN = 0]
+stringeq        [test $HAVE_POSIX_SPAWN = 0]
 bool            [test $HAVE_POSIX_SPAWN = 0]
 windows-spawn   [test $HAVE_POSIX_SPAWN = 0]
 
index 427eec7896e1a8ad680784b240be4c6e06e0dedd..3f6aa0f9b84d47c28631a71ab68d50edc692d636 100644 (file)
@@ -14,6 +14,7 @@ mbchar
 mbuiter
 iconv
 localcharset
+stringeq
 c-strcasecmp
 xstriconv
 xalloc
index 57775b24d6c410f1ec7e32df150ef50ac72ea5bd..3cc4e21d76aa6570a2068b965c3620931185b661 100644 (file)
@@ -11,6 +11,7 @@ root-uid
 stdlib-h
 configmake
 stat
+stringeq
 
 configure.ac:
 
index a6f425d252975e2e70463f27d00989b64e64748c..108ac8b8ae9ef961e4bf3e6034f7f67c8df970e3 100644 (file)
@@ -10,6 +10,7 @@ stdlib-h
 environ         [test $REPLACE_PUTENV = 1]
 free-posix      [test $REPLACE_PUTENV = 1]
 malloc-posix    [test $REPLACE_PUTENV = 1]
+stringeq        [test $REPLACE_PUTENV = 1]
 unsetenv        [test $REPLACE_PUTENV = 1]
 
 configure.ac:
index 8adedf7ad9ff08ed7fea6a7e1e2a7941fd2d92fa..857b45e85b7b1021676d7ec85e3abfdf49adc01a 100644 (file)
@@ -10,6 +10,7 @@ Depends-on:
 acl-permissions
 dirent-h        [test "$use_xattr" = yes]
 file-has-acl    [test "$use_xattr" = yes]
+stringeq        [test "$use_xattr" = yes]
 
 configure.ac:
 gl_QCOPY_ACL
index 657047da1d4b8aa53dca8c23a6e14a5999369307..fb32389a09d190f19c3e8bf360b16b517796014a 100644 (file)
@@ -13,6 +13,7 @@ gettext-h       [test $HAVE_RPMATCH = 0]
 gnulib-i18n     [test $HAVE_RPMATCH = 0]
 regex           [test $HAVE_RPMATCH = 0]
 strdup          [test $HAVE_RPMATCH = 0]
+stringeq        [test $HAVE_RPMATCH = 0]
 
 configure.ac:
 gl_FUNC_RPMATCH
@@ -39,4 +40,3 @@ GPL
 
 Maintainer:
 Jim Meyering
-
index ae5841e0efd532b89adfbc2aa482e731f61122ce..8f85c8e744d1cebc39e3dc1a6b0619d640df0f00 100644 (file)
@@ -18,6 +18,7 @@ errno-h
 sys_types-h
 extern-inline
 gen-header
+stringeq
 
 configure.ac:
 gl_HEADERS_SELINUX_SELINUX_H
index df5b9c014df327b205b71e4283096d9db1020974..76c7dc13e79011652ee25c1591525bb70164a915 100644 (file)
@@ -10,6 +10,7 @@ stdlib-h
 malloca         [test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1]
 alloca-opt      [test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1]
 malloc-posix    [test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1]
+stringeq        [test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1]
 unistd-h        [test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1]
 environ         [test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1]
 
index 4cf9597ea8d57fa60929c213fd4753a09a20c52f..5f718380111bc7e987edd0f5bfcc311cd3b45573 100644 (file)
@@ -7,6 +7,7 @@ m4/setlocale.m4
 
 Depends-on:
 locale-h
+stringeq
 setlocale-fixes    [test $NEED_SETLOCALE_IMPROVED = 1]
 localename         [test $NEED_SETLOCALE_IMPROVED = 1]
 localename-environ [test $NEED_SETLOCALE_IMPROVED = 1]
index a397793da9c10f4f410efff5b219f718d8170d99..7ab3bd821c4f28ef2da7ca07fc2718fda79040e3 100644 (file)
@@ -6,6 +6,7 @@ lib/setlocale-fixes.h
 lib/setlocale-fixes.c
 
 Depends-on:
+stringeq
 
 configure.ac:
 AC_REQUIRE([AC_CANONICAL_HOST])
index 8055a58ff1ce8ca4ed6db3dc89c1f4a4a06ade80..11b03ab47bc7233046d563fb754a9d0dd2cd836a 100644 (file)
@@ -8,6 +8,7 @@ m4/sig2str.m4
 
 Depends-on:
 signal-h
+stringeq
 
 configure.ac:
 gl_FUNC_SIG2STR
index 494c01bc63a5a69d6af6618127c5064092e737a1..e1fe269da8c36d05598b4fa458acf7165f50ed41 100644 (file)
@@ -39,6 +39,7 @@ posix_spawnattr_setflags
 posix_spawnattr_destroy
 bool
 stdlib-h
+stringeq
 unistd-h
 unistd-safer
 wait-process
index dc918550495fbcbe46c1411164bf8493273fc7f8..79c2087fc1f0d18dd0f6c3cb04f6f5994b33f015 100644 (file)
@@ -15,6 +15,7 @@ filename        [test $REPLACE_STAT = 1]
 malloca         [test $REPLACE_STAT = 1]
 pathmax         [test $REPLACE_STAT = 1]
 stat-time       [test $REPLACE_STAT = 1]
+stringeq        [test $REPLACE_STAT = 1]
 bool            [test $REPLACE_STAT = 1]
 
 configure.ac:
index aceb295ca8f7ee8e20a8d5df4362273188ba4600..9281e00c2bf960e9d22d7d37cd84e5ab6647bc7a 100644 (file)
@@ -6,6 +6,7 @@ lib/str_endswith.c
 
 Depends-on:
 string-h
+stringeq
 bool
 
 configure.ac:
index de509ccb29be5af8126ededea3485d517bffaf40..aadce69305128ac7316a554fee53068ad9a01787 100644 (file)
@@ -5,6 +5,7 @@ Files:
 lib/streq.h
 
 Depends-on:
+stringeq
 
 configure.ac:
 
index 090855ccc9e6eff1d4f4daf2f7e60752465eeb43..01d8c4d6e490f567c8919b20b7327199291c72fb 100644 (file)
@@ -11,6 +11,7 @@ bool
 striconveh
 malloca
 strdup
+stringeq
 c-strcasecmp
 
 configure.ac:
index 36f7278c33f650eeec124c5af09da5a29d434190..51c167b9aa6319da3a80fc28833f12ee97d0146d 100644 (file)
@@ -10,6 +10,7 @@ Depends-on:
 c99
 fcntl-h
 bool
+stringeq
 sys_stat-h
 clean-temp
 tempname
index ac5a0e7a84bffe92916c3becaa9e647d8e4eb424..1981b81920926deb41eec3d90e4bd12843e2f605 100644 (file)
@@ -14,6 +14,7 @@ flexmember     [test $HAVE_TZALLOC = 0 || test $REPLACE_LOCALTIME_RZ = 1 || test
 idx            [test $HAVE_TZALLOC = 0 || test $REPLACE_LOCALTIME_RZ = 1 || test $REPLACE_MKTIME_Z = 1]
 setenv         [test $HAVE_TZALLOC = 0 || test $REPLACE_LOCALTIME_RZ = 1 || test $REPLACE_MKTIME_Z = 1]
 bool           [test $HAVE_TZALLOC = 0 || test $REPLACE_LOCALTIME_RZ = 1 || test $REPLACE_MKTIME_Z = 1]
+stringeq       [test $HAVE_TZALLOC = 0 || test $REPLACE_LOCALTIME_RZ = 1 || test $REPLACE_MKTIME_Z = 1]
 time_r         [test $HAVE_TZALLOC = 0 || test $REPLACE_LOCALTIME_RZ = 1 || test $REPLACE_MKTIME_Z = 1]
 timegm         [test $HAVE_TZALLOC = 0 || test $REPLACE_LOCALTIME_RZ = 1 || test $REPLACE_MKTIME_Z = 1]
 tzset          [test $HAVE_TZALLOC = 0 || test $REPLACE_LOCALTIME_RZ = 1 || test $REPLACE_MKTIME_Z = 1]
index 636085985758aa82574a08dce209b4f0e0e3a532..a9a905db0c8f62c00c487c2956d8a0aaef3d7122 100644 (file)
@@ -15,6 +15,7 @@ snippet/warn-on-use
 extern-inline
 assert-h
 stdint-h
+stringeq
 wchar-h
 wctype-h
 
index 0b84d992bf7dba9cfde0e4894995eb902dc9f24f..379bbf5938a0bc2e8a73603f211e81f089f9facc 100644 (file)
@@ -16,6 +16,7 @@ gnulib-i18n
 localcharset
 error
 stdio-h
+stringeq
 
 configure.ac:
 gl_UNICODEIO
index f60d1b468d91b89dc6eab0b1eea0ecabb24f4091..432348c8635b6df0c36500b6979e05793b9a075e 100644 (file)
@@ -11,6 +11,7 @@ m4/libunistring-base.m4
 Depends-on:
 gen-header
 bool
+stringeq
 unitypes-h
 
 configure.ac:
index 3412903161b8b4347ff7bacf60cf1bd3538440b6..f70b7790d4a3938c1c409abf8adbdd024e4b219e 100644 (file)
@@ -7,6 +7,7 @@ lib/wctrans-impl.h
 m4/wctrans.m4
 
 Depends-on:
+stringeq
 wctype-h
 # When we override wctrans_t, we also need to override towctrans().
 towctrans       [test $REPLACE_WCTRANS = 1]
index 69f2deb608c020796ac45b3a16548148bb7c1b63..b19b746753340766c7303928fe4bcc63917257a4 100644 (file)
@@ -12,6 +12,7 @@ iswblank        [test $HAVE_WCTYPE = 0 || test $REPLACE_WCTYPE = 1]
 iswdigit        [test $HAVE_WCTYPE = 0 || test $REPLACE_WCTYPE = 1]
 iswpunct        [test $HAVE_WCTYPE = 0 || test $REPLACE_WCTYPE = 1]
 iswxdigit       [test $HAVE_WCTYPE = 0 || test $REPLACE_WCTYPE = 1]
+stringeq        [test $HAVE_WCTYPE = 0 || test $REPLACE_WCTYPE = 1]
 # When we override wctype_t, we also need to override iswctype().
 iswctype        [test $REPLACE_WCTYPE = 1]