]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Avoid possible future conflict with gnulib module 'dirname'.
authorBruno Haible <bruno@clisp.org>
Sun, 5 Jul 2020 20:47:41 +0000 (22:47 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 5 Jul 2020 21:43:25 +0000 (23:43 +0200)
* gnulib-local/lib/basename.c: Remove file.
* gnulib-local/lib/basename.h: Remove file.
* gnulib-local/modules/basename: Remove file.
* gnulib-local/Makefile.am (EXTRA_DIST): Remove them.
* gnulib-local/lib/addext.c: Include basename-lgpl.h instead of basename.h.
(addext): Invoke last_component instead of basename.
* gnulib-local/lib/backupfile.c: Include basename-lgpl.h instead of basename.h.
(find_backup_file_name): Invoke last_component instead of basename.
* gnulib-local/modules/backupfile (Depends-on): Remove basename. Add
basename-lgpl.
* autogen.sh (GNULIB_MODULES_RUNTIME_FOR_SRC, GNULIB_MODULES_TOOLS_FOR_SRC,
GNULIB_MODULES_LIBGETTEXTPO): Remove basename. Add basename-lgpl.
* gettext-runtime/src/envsubst.c: Include basename-lgpl.h instead of basename.h.
(main): Invoke last_component instead of basename.
* gettext-runtime/src/gettext.c: Likewise.
* gettext-runtime/src/ngettext.c: Likewise.
* gettext-tools/src/cldr-plurals.c: Likewise.
* gettext-tools/src/hostname.c: Likewise.
* gettext-tools/src/msgattrib.c: Likewise.
* gettext-tools/src/msgcat.c: Likewise.
* gettext-tools/src/msgcmp.c: Likewise.
* gettext-tools/src/msgcomm.c: Likewise.
* gettext-tools/src/msgconv.c: Likewise.
* gettext-tools/src/msgen.c: Likewise.
* gettext-tools/src/msgexec.c: Likewise.
* gettext-tools/src/msgfilter.c: Likewise.
* gettext-tools/src/msgfmt.c: Likewise.
* gettext-tools/src/msggrep.c: Likewise.
* gettext-tools/src/msginit.c: Likewise.
* gettext-tools/src/msgmerge.c: Likewise.
* gettext-tools/src/msgunfmt.c: Likewise.
* gettext-tools/src/msguniq.c: Likewise.
* gettext-tools/src/urlget.c: Likewise.
* gettext-tools/src/xgettext.c: Likewise.
* gettext-tools/tests/tstgettext.c: Likewise.
* gettext-tools/tests/tstngettext.c: Likewise. Include <string.h>.
* gettext-tools/src/recode-sr-latin.c: Include basename-lgpl.h instead of
basename.h.
(main, process): Invoke last_component instead of basename.
* gettext-tools/src/locating-rule.c: Include basename-lgpl.h instead of
basename.h.
(locating_rule_match): Invoke last_component instead of basename.
* gettext-tools/src/msgl-cat.c: Include basename-lgpl.h instead of basename.h.
(catenate_msgdomain_list): Invoke last_component instead of basename.
* gettext-tools/src/msgl-charset.c: Include basename-lgpl.h instead of
basename.h.
(compare_po_locale_charsets): Invoke last_component instead of basename.
* gettext-tools/src/msgl-iconv.c: Include basename-lgpl.h instead of basename.h.
(iconv_message_list_internal): Invoke last_component instead of basename.
* gettext-tools/src/po-charset.c: Include basename-lgpl.h instead of basename.h.
(po_lex_charset_set): Invoke last_component instead of basename.
* gettext-tools/src/x-python.c: Include basename-lgpl.h instead of basename.h.
(set_current_file_source_encoding): Invoke last_component instead of basename.
* gettext-tools/src/x-javascript.c: Don't include basename.h.

40 files changed:
.gitignore
autogen.sh
gettext-runtime/src/envsubst.c
gettext-runtime/src/gettext.c
gettext-runtime/src/ngettext.c
gettext-tools/src/cldr-plurals.c
gettext-tools/src/hostname.c
gettext-tools/src/locating-rule.c
gettext-tools/src/msgattrib.c
gettext-tools/src/msgcat.c
gettext-tools/src/msgcmp.c
gettext-tools/src/msgcomm.c
gettext-tools/src/msgconv.c
gettext-tools/src/msgen.c
gettext-tools/src/msgexec.c
gettext-tools/src/msgfilter.c
gettext-tools/src/msgfmt.c
gettext-tools/src/msggrep.c
gettext-tools/src/msginit.c
gettext-tools/src/msgl-cat.c
gettext-tools/src/msgl-charset.c
gettext-tools/src/msgl-iconv.c
gettext-tools/src/msgmerge.c
gettext-tools/src/msgunfmt.c
gettext-tools/src/msguniq.c
gettext-tools/src/po-charset.c
gettext-tools/src/recode-sr-latin.c
gettext-tools/src/urlget.c
gettext-tools/src/x-javascript.c
gettext-tools/src/x-python.c
gettext-tools/src/xgettext.c
gettext-tools/tests/tstgettext.c
gettext-tools/tests/tstngettext.c
gnulib-local/Makefile.am
gnulib-local/lib/addext.c
gnulib-local/lib/backupfile.c
gnulib-local/lib/basename.c [deleted file]
gnulib-local/lib/basename.h [deleted file]
gnulib-local/modules/backupfile
gnulib-local/modules/basename [deleted file]

index 51257162c4798e77d9889df3f304694a0568ea48..84cfa688a64aa418c7cb76c59ab9bcc81a78ca09 100644 (file)
@@ -75,8 +75,6 @@
 /gettext-tools/libgettextpo/attribute.h
 /gettext-tools/libgettextpo/basename-lgpl.c
 /gettext-tools/libgettextpo/basename-lgpl.h
-/gettext-tools/libgettextpo/basename.c
-/gettext-tools/libgettextpo/basename.h
 /gettext-tools/libgettextpo/c-ctype.c
 /gettext-tools/libgettextpo/c-ctype.h
 /gettext-tools/libgettextpo/c-strcase.h
index 5678c5ff93478a26ca8d53fa4b8b2b216396ff0e..ca17cd952c8358fcc843f7141d12c4aef3c95da9 100755 (executable)
@@ -70,7 +70,7 @@ if ! $skip_gnulib; then
   # In gettext-runtime:
   GNULIB_MODULES_RUNTIME_FOR_SRC='
     atexit
-    basename
+    basename-lgpl
     binary-io
     closeout
     error
@@ -123,7 +123,7 @@ if ! $skip_gnulib; then
     alloca-opt
     atexit
     backupfile
-    basename
+    basename-lgpl
     binary-io
     bison
     bison-i18n
@@ -291,7 +291,7 @@ if ! $skip_gnulib; then
   # In gettext-tools/libgettextpo:
   # This is a subset of the GNULIB_MODULES_FOR_SRC.
   GNULIB_MODULES_LIBGETTEXTPO='
-    basename
+    basename-lgpl
     close
     c-ctype
     c-strcase
index 0b55080765c0eb83b003bc5c122ba177f4675e7b..ffe4ce79d4ddd0212a65dc677b738c933c04ca75 100644 (file)
@@ -33,7 +33,7 @@
 #include "error.h"
 #include "progname.h"
 #include "relocatable.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "xalloc.h"
 #include "propername.h"
 #include "binary-io.h"
@@ -104,7 +104,8 @@ main (int argc, char *argv[])
   /* Version information is requested.  */
   if (do_version)
     {
-      printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+      printf ("%s (GNU %s) %s\n", last_component (program_name),
+              PACKAGE, VERSION);
       /* xgettext: no-wrap */
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <%s>\n\
index 50770cf5c23a0e65ed874c17ffd93e555bc5a8e1..99fd82d6a00d4bf31b66e82aca2ada0348ec9612 100644 (file)
@@ -32,7 +32,7 @@
 #include "error.h"
 #include "progname.h"
 #include "relocatable.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "xalloc.h"
 #include "propername.h"
 #include "escapes.h"
@@ -129,7 +129,8 @@ main (int argc, char *argv[])
   /* Version information is requested.  */
   if (do_version)
     {
-      printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+      printf ("%s (GNU %s) %s\n", last_component (program_name),
+              PACKAGE, VERSION);
       /* xgettext: no-wrap */
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <%s>\n\
index 841665c616e0f8ff418b3e6a524a8fce19f53f9a..d10f2c3c79b15c265cdd723c23f320ecb2d841b0 100644 (file)
@@ -31,7 +31,7 @@
 #include "error.h"
 #include "progname.h"
 #include "relocatable.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "xalloc.h"
 #include "propername.h"
 #include "escapes.h"
@@ -118,7 +118,8 @@ main (int argc, char *argv[])
   /* Version information is requested.  */
   if (do_version)
     {
-      printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+      printf ("%s (GNU %s) %s\n", last_component (program_name),
+              PACKAGE, VERSION);
       /* xgettext: no-wrap */
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <%s>\n\
index ac0e693edca04da8a4e1673e55946bb3c92b03d4..94a2cdf7948587d3868ca76e04a8059e34e82792 100644 (file)
@@ -20,7 +20,7 @@
 # include <config.h>
 #endif
 
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "cldr-plural-exp.h"
 #include "closeout.h"
 #include "c-ctype.h"
@@ -286,7 +286,8 @@ main (int argc, char **argv)
   /* Version information requested.  */
   if (do_version)
     {
-      printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+      printf ("%s (GNU %s) %s\n", last_component (program_name),
+              PACKAGE, VERSION);
       /* xgettext: no-wrap */
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <%s>\n\
index cead2cfaa5157e2f98401571de0da5dce7582b33..295b0b4ee18d7ef47377c59e589b5a4894b28fa5 100644 (file)
@@ -87,7 +87,7 @@
 #include "error-progname.h"
 #include "progname.h"
 #include "relocatable.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "xalloc.h"
 #include "propername.h"
 #include "gettext.h"
@@ -171,7 +171,8 @@ main (int argc, char *argv[])
   /* Version information requested.  */
   if (do_version)
     {
-      printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+      printf ("%s (GNU %s) %s\n", last_component (program_name),
+              PACKAGE, VERSION);
       /* xgettext: no-wrap */
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <%s>\n\
index 1a54d4d28e147e3692fc7d783663adf108a256b8..15faee12195dd6b6791d58b3f4a20bdbe8f8d5ec 100644 (file)
@@ -23,7 +23,7 @@
 /* Specification.  */
 #include "locating-rule.h"
 
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "concat-filename.h"
 #include "c-strcase.h"
 
@@ -146,7 +146,7 @@ locating_rule_match (struct locating_rule_ty *rule,
              && memcmp (reduced + strlen (reduced) - 3, ".in", 3) == 0)
         reduced[strlen (reduced) - 3] = '\0';
 
-      err = fnmatch (rule->pattern, basename (reduced), FNM_PATHNAME);
+      err = fnmatch (rule->pattern, last_component (reduced), FNM_PATHNAME);
       free (reduced);
       if (err != 0)
         return NULL;
index 7e6f2ff3c14101cbb05b53c8abfc2b3f7558cc62..f9d60d1d832a677fe0cf3fc1d6abad9f5c5e186c 100644 (file)
@@ -36,7 +36,7 @@
 #include "error-progname.h"
 #include "progname.h"
 #include "relocatable.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "message.h"
 #include "read-catalog.h"
 #include "read-po.h"
@@ -347,7 +347,8 @@ main (int argc, char **argv)
   /* Version information requested.  */
   if (do_version)
     {
-      printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+      printf ("%s (GNU %s) %s\n", last_component (program_name),
+              PACKAGE, VERSION);
       /* xgettext: no-wrap */
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <%s>\n\
index d58ee91ff9d87d916a33cf73ec884333e51516b4..a8c4d50328d20baa53eb19282a6ad30767c57c2a 100644 (file)
@@ -37,7 +37,7 @@
 #include "error-progname.h"
 #include "progname.h"
 #include "relocatable.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "message.h"
 #include "read-catalog.h"
 #include "read-po.h"
@@ -285,7 +285,8 @@ main (int argc, char **argv)
   /* Version information requested.  */
   if (do_version)
     {
-      printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+      printf ("%s (GNU %s) %s\n", last_component (program_name),
+              PACKAGE, VERSION);
       /* xgettext: no-wrap */
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <%s>\n\
index 2dfb749735be950754b3e943f589fc0b042124ad..7d9478d628d150549265b33a757d61b673c2b455 100644 (file)
@@ -34,7 +34,7 @@
 #include "error-progname.h"
 #include "progname.h"
 #include "relocatable.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "message.h"
 #include "read-catalog.h"
 #include "read-po.h"
@@ -163,7 +163,8 @@ main (int argc, char *argv[])
   /* Version information is requested.  */
   if (do_version)
     {
-      printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+      printf ("%s (GNU %s) %s\n", last_component (program_name),
+              PACKAGE, VERSION);
       /* xgettext: no-wrap */
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <%s>\n\
index ed362dad0bfb90cd9769391fcf4bc77cafae10f8..e24a61ef6ac95f88a28edc74536b4118174c7d67 100644 (file)
@@ -37,7 +37,7 @@
 #include "error-progname.h"
 #include "progname.h"
 #include "relocatable.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "message.h"
 #include "read-catalog.h"
 #include "read-po.h"
@@ -276,7 +276,8 @@ main (int argc, char *argv[])
   /* Version information requested.  */
   if (do_version)
     {
-      printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+      printf ("%s (GNU %s) %s\n", last_component (program_name),
+              PACKAGE, VERSION);
       /* xgettext: no-wrap */
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <%s>\n\
index d4f1e531b3ebdd7877c069a020343fcd7470e892..e7fa054047c6086fa5ca466b8e1198f6448bef21 100644 (file)
@@ -36,7 +36,7 @@
 #include "error-progname.h"
 #include "progname.h"
 #include "relocatable.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "message.h"
 #include "read-catalog.h"
 #include "read-po.h"
@@ -236,7 +236,8 @@ main (int argc, char **argv)
   /* Version information is requested.  */
   if (do_version)
     {
-      printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+      printf ("%s (GNU %s) %s\n", last_component (program_name),
+              PACKAGE, VERSION);
       /* xgettext: no-wrap */
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <%s>\n\
index 960adda145089131fa44780d087d87f8753df45d..40ca9de7498f6e927c21c3641b267c41e9f0db32 100644 (file)
@@ -36,7 +36,7 @@
 #include "error-progname.h"
 #include "progname.h"
 #include "relocatable.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "message.h"
 #include "read-catalog.h"
 #include "read-po.h"
@@ -233,7 +233,8 @@ main (int argc, char **argv)
   /* Version information is requested.  */
   if (do_version)
     {
-      printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+      printf ("%s (GNU %s) %s\n", last_component (program_name),
+              PACKAGE, VERSION);
       /* xgettext: no-wrap */
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <%s>\n\
index 13411da38262ab58f7e4fd123fa00f8ec217dea8..811e0fa09ed05c2807bea395f24a07060fde90d4 100644 (file)
@@ -39,7 +39,7 @@
 #include "error-progname.h"
 #include "progname.h"
 #include "relocatable.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "message.h"
 #include "read-catalog.h"
 #include "read-po.h"
@@ -177,7 +177,8 @@ main (int argc, char **argv)
   /* Version information is requested.  */
   if (do_version)
     {
-      printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+      printf ("%s (GNU %s) %s\n", last_component (program_name),
+              PACKAGE, VERSION);
       /* xgettext: no-wrap */
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <%s>\n\
index f5e4e64fefb4271227ffcf7310946b1d43886d8e..726d1215ff50c105846a9fc910f97de29dc844e5 100644 (file)
@@ -40,7 +40,7 @@
 #include "error-progname.h"
 #include "progname.h"
 #include "relocatable.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "message.h"
 #include "read-catalog.h"
 #include "read-po.h"
@@ -280,7 +280,8 @@ main (int argc, char **argv)
   /* Version information is requested.  */
   if (do_version)
     {
-      printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+      printf ("%s (GNU %s) %s\n", last_component (program_name),
+              PACKAGE, VERSION);
       /* xgettext: no-wrap */
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <%s>\n\
index 4da5bfa0d07a1e3b648abbde42ec0ab9ba7bb7cd..f990152d262d7b19491c297a9e47567b19146635 100644 (file)
@@ -39,7 +39,7 @@
 #include "error-progname.h"
 #include "progname.h"
 #include "relocatable.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "xerror.h"
 #include "xvasprintf.h"
 #include "xalloc.h"
@@ -436,7 +436,8 @@ main (int argc, char *argv[])
   /* Version information is requested.  */
   if (do_version)
     {
-      printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+      printf ("%s (GNU %s) %s\n", last_component (program_name),
+              PACKAGE, VERSION);
       /* xgettext: no-wrap */
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <%s>\n\
index 6bb1a74a4c3d1efb962ba6d6047c3ec58aa7d314..f14ed69db8de323800a8acf2bf6b2eeb4157d971 100644 (file)
@@ -47,7 +47,7 @@
 #include "error-progname.h"
 #include "progname.h"
 #include "relocatable.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "message.h"
 #include "read-catalog.h"
 #include "read-po.h"
@@ -407,7 +407,8 @@ main (int argc, char **argv)
   /* Version information is requested.  */
   if (do_version)
     {
-      printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+      printf ("%s (GNU %s) %s\n", last_component (program_name),
+              PACKAGE, VERSION);
       /* xgettext: no-wrap */
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <%s>\n\
index ff0b7d78241e83d2e9ae5a89115ae33bed0c3ea9..9a227ba5688c6c7021e71ff62ea9c7e52cf09d6d 100644 (file)
@@ -60,7 +60,7 @@
 #include "error-progname.h"
 #include "progname.h"
 #include "relocatable.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "c-strstr.h"
 #include "c-strcase.h"
 #include "message.h"
@@ -263,7 +263,8 @@ main (int argc, char **argv)
   /* Version information is requested.  */
   if (do_version)
     {
-      printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+      printf ("%s (GNU %s) %s\n", last_component (program_name),
+              PACKAGE, VERSION);
       /* xgettext: no-wrap */
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <%s>\n\
index 2e806497cdef4d27f429d21bed7850131163a788..990d39e925db928741bf096937b3e4257af0f7b5 100644 (file)
@@ -1,5 +1,5 @@
 /* Message list concatenation and duplicate handling.
-   Copyright (C) 2001-2003, 2005-2008, 2012, 2015, 2019 Free Software
+   Copyright (C) 2001-2003, 2005-2008, 2012, 2015, 2019-2020 Free Software
    Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
@@ -43,7 +43,7 @@
 #include "xalloc.h"
 #include "xmalloca.h"
 #include "c-strstr.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "gettext.h"
 
 #define _(str) gettext (str)
@@ -217,7 +217,7 @@ catenate_msgdomain_list (string_list_ty *file_list,
   identifications = XNMALLOC (nfiles, const char **);
   for (n = 0; n < nfiles; n++)
     {
-      const char *filename = basename (files[n]);
+      const char *filename = last_component (files[n]);
       msgdomain_list_ty *mdlp = mdlps[n];
       size_t k;
 
index 42d182e91cfefc5add55bc0919445c8fcf6fb698..9cf0cc4248e4012f76acb4f5f6b5fd78c055db74 100644 (file)
@@ -1,5 +1,5 @@
 /* Message list charset and locale charset handling.
-   Copyright (C) 2001-2003, 2005-2007, 2009, 2019 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2005-2007, 2009, 2019-2020 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -32,7 +32,7 @@
 #include "localcharset.h"
 #include "error.h"
 #include "progname.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "xmalloca.h"
 #include "xerror.h"
 #include "xvasprintf.h"
@@ -94,7 +94,7 @@ Locale charset \"%s\" is different from\n\
 input file charset \"%s\".\n\
 Output of '%s' might be incorrect.\n\
 Possible workarounds are:\n\
-"), locale_code, canon_charset, basename (program_name)));
+"), locale_code, canon_charset, last_component (program_name)));
                         multiline_warning (NULL,
                                            xasprintf (_("\
 - Set LC_ALL to a locale with encoding %s.\n\
@@ -105,7 +105,7 @@ Possible workarounds are:\n\
 - Convert the translation catalog to %s using 'msgconv',\n\
   then apply '%s',\n\
   then convert back to %s using 'msgconv'.\n\
-"), canon_locale_code, basename (program_name), canon_charset));
+"), canon_locale_code, last_component (program_name), canon_charset));
                         if (strcmp (canon_charset, "UTF-8") != 0
                             && (canon_locale_code == NULL
                                 || strcmp (canon_locale_code, "UTF-8") != 0))
@@ -115,7 +115,7 @@ Possible workarounds are:\n\
   convert the translation catalog to %s using 'msgconv',\n\
   then apply '%s',\n\
   then convert back to %s using 'msgconv'.\n\
-"), "UTF-8", "UTF-8", basename (program_name), canon_charset));
+"), "UTF-8", "UTF-8", last_component (program_name), canon_charset));
                         warned = true;
                       }
                   }
@@ -128,5 +128,5 @@ Possible workarounds are:\n\
 Locale charset \"%s\" is not a portable encoding name.\n\
 Output of '%s' might be incorrect.\n\
 A possible workaround is to set LC_ALL=C.\n\
-"), locale_code, basename (program_name)));
+"), locale_code, last_component (program_name)));
 }
index c66d14a0be2e8f043e0857fd79e5db55ab6eaac7..0b5ed107e831d53229963a5d55b5356922623c2d 100644 (file)
@@ -34,7 +34,7 @@
 
 #include "noreturn.h"
 #include "progname.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "message.h"
 #include "po-charset.h"
 #include "xstriconv.h"
@@ -298,7 +298,7 @@ iconv_message_list_internal (message_list_ty *mlp,
         po_xerror (PO_SEVERITY_FATAL_ERROR, NULL, NULL, 0, 0, false,
                    xasprintf (_("Cannot convert from \"%s\" to \"%s\". %s relies on iconv(), and iconv() does not support this conversion."),
                               canon_from_code, canon_to_code,
-                              basename (program_name)));
+                              last_component (program_name)));
 
       context.from_code = canon_from_code;
       context.to_code = canon_to_code;
@@ -330,7 +330,7 @@ iconv_message_list_internal (message_list_ty *mlp,
           po_xerror (PO_SEVERITY_FATAL_ERROR, NULL, NULL, 0, 0, false,
                      xasprintf (_("Cannot convert from \"%s\" to \"%s\". %s relies on iconv(). This version was built without iconv()."),
                                 canon_from_code, canon_to_code,
-                                basename (program_name)));
+                                last_component (program_name)));
 #endif
     }
 
index 42facb2805f4d9062e7b1aa5b6866d69aa856b0d..338532a86ef868724e6f9dbfb7ea7531bafd3bec 100644 (file)
@@ -41,7 +41,7 @@
 #include "error-progname.h"
 #include "progname.h"
 #include "relocatable.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "message.h"
 #include "read-catalog.h"
 #include "read-po.h"
@@ -364,7 +364,8 @@ main (int argc, char **argv)
   /* Version information is requested.  */
   if (do_version)
     {
-      printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+      printf ("%s (GNU %s) %s\n", last_component (program_name),
+              PACKAGE, VERSION);
       /* xgettext: no-wrap */
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <%s>\n\
index 8120316c9a28ba2e41946177cd0350d27d5a33b9..030f332062e4da8b8e4a6381c214af33d811277b 100644 (file)
@@ -35,7 +35,7 @@
 #include "error-progname.h"
 #include "progname.h"
 #include "relocatable.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "message.h"
 #include "msgunfmt.h"
 #include "read-mo.h"
@@ -254,7 +254,8 @@ main (int argc, char **argv)
   /* Version information is requested.  */
   if (do_version)
     {
-      printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+      printf ("%s (GNU %s) %s\n", last_component (program_name),
+              PACKAGE, VERSION);
       /* xgettext: no-wrap */
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <%s>\n\
index 6616ced3eebaa34c5559a14a1aea246260427ddd..2a18b22796a6fc9967105ee48868dc448f436723 100644 (file)
@@ -37,7 +37,7 @@
 #include "error-progname.h"
 #include "progname.h"
 #include "relocatable.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "message.h"
 #include "read-catalog.h"
 #include "read-po.h"
@@ -256,7 +256,8 @@ main (int argc, char **argv)
   /* Version information requested.  */
   if (do_version)
     {
-      printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+      printf ("%s (GNU %s) %s\n", last_component (program_name),
+              PACKAGE, VERSION);
       /* xgettext: no-wrap */
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <%s>\n\
index 703b6f9d83dbc79c4b9139983d669582fcc87924..2e92c69e29ba0bc360e664463a089550f88b822d 100644 (file)
@@ -1,5 +1,5 @@
 /* Charset handling while reading PO files.
-   Copyright (C) 2001-2007, 2010, 2019 Free Software Foundation, Inc.
+   Copyright (C) 2001-2007, 2010, 2019-2020 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -31,7 +31,7 @@
 #include "xvasprintf.h"
 #include "po-xerror.h"
 #if !IN_LIBGETTEXTPO
-# include "basename.h"
+# include "basename-lgpl.h"
 # include "progname.h"
 #endif
 #include "c-strstr.h"
@@ -559,7 +559,7 @@ Message conversion to user's charset might not work.\n"),
 # if IN_LIBGETTEXTPO
                   progname = "libgettextpo";
 # else
-                  progname = basename (program_name);
+                  progname = last_component (program_name);
 # endif
 
                   warning_message =
@@ -615,7 +615,7 @@ would fix this problem.\n");
 # if IN_LIBGETTEXTPO
                   progname = "libgettextpo";
 # else
-                  progname = basename (program_name);
+                  progname = last_component (program_name);
 # endif
 
                   warning_message =
index 23d21cde45eaa05d4415f664e15c031a46bbf593..a7f67ba9001340c27c2532b7b12b3442c29f5107 100644 (file)
@@ -36,7 +36,7 @@
 #include "error.h"
 #include "progname.h"
 #include "relocatable.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "xalloc.h"
 #include "localcharset.h"
 #include "c-strcase.h"
@@ -101,7 +101,8 @@ main (int argc, char *argv[])
   /* Version information is requested.  */
   if (do_version)
     {
-      printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+      printf ("%s (GNU %s) %s\n", last_component (program_name),
+              PACKAGE, VERSION);
       /* xgettext: no-wrap */
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <%s>\n\
@@ -288,11 +289,11 @@ process (FILE *stream)
       if (conv_to_utf8 == (iconv_t)(-1))
         error (EXIT_FAILURE, 0,
                _("Cannot convert from \"%s\" to \"%s\". %s relies on iconv(), and iconv() does not support this conversion."),
-               locale_code, "UTF-8", basename (program_name));
+               locale_code, "UTF-8", last_component (program_name));
       if (conv_from_utf8 == (iconv_t)(-1))
         error (EXIT_FAILURE, 0,
                _("Cannot convert from \"%s\" to \"%s\". %s relies on iconv(), and iconv() does not support this conversion."),
-               "UTF-8", locale_code, basename (program_name));
+               "UTF-8", locale_code, last_component (program_name));
       last_utf8_line = NULL;
       last_utf8_line_len = 0;
       last_backconv_line = NULL;
@@ -300,7 +301,7 @@ process (FILE *stream)
 #else
       error (EXIT_FAILURE, 0,
              _("Cannot convert from \"%s\" to \"%s\". %s relies on iconv(). This version was built without iconv()."),
-             locale_code, "UTF-8", basename (program_name));
+             locale_code, "UTF-8", last_component (program_name));
 #endif
     }
 
index 97e9d0fda5a088758743be2a488883dbd0fe59fb..84e20043d3b384f8fd56a26bcddaa3b2ecbde1fd 100644 (file)
@@ -36,7 +36,7 @@
 #include "error-progname.h"
 #include "progname.h"
 #include "relocatable.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "full-write.h"
 #include "execute.h"
 #include "javaexec.h"
@@ -134,7 +134,8 @@ main (int argc, char *argv[])
   /* Version information requested.  */
   if (do_version)
     {
-      printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+      printf ("%s (GNU %s) %s\n", last_component (program_name),
+              PACKAGE, VERSION);
       /* xgettext: no-wrap */
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <%s>\n\
index 34da71760ac9b88b1206d18c15c101d2acc058b6..54ab51a7b6d3ab85ef1c47365942e05cadbf4f0c 100644 (file)
@@ -44,7 +44,6 @@
 #include "error.h"
 #include "error-progname.h"
 #include "progname.h"
-#include "basename.h"
 #include "xerror.h"
 #include "xvasprintf.h"
 #include "xalloc.h"
index ed319f13a0d7608965d3aef2441f49475db7f725..1dee06100ca80a9124bdef34854725e0a0514644 100644 (file)
@@ -43,7 +43,7 @@
 #include "error.h"
 #include "error-progname.h"
 #include "progname.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "xerror.h"
 #include "xvasprintf.h"
 #include "xalloc.h"
@@ -623,13 +623,13 @@ set_current_file_source_encoding (const char *canon_encoding)
         error_at_line (EXIT_FAILURE, 0, logical_file_name, line_number - 1,
                        _("Cannot convert from \"%s\" to \"%s\". %s relies on iconv(), and iconv() does not support this conversion."),
                        xgettext_current_file_source_encoding, po_charset_utf8,
-                       basename (program_name));
+                       last_component (program_name));
       xgettext_current_file_source_iconv = cd;
 #else
       error_at_line (EXIT_FAILURE, 0, logical_file_name, line_number - 1,
                      _("Cannot convert from \"%s\" to \"%s\". %s relies on iconv(). This version was built without iconv()."),
                      xgettext_current_file_source_encoding, po_charset_utf8,
-                     basename (program_name));
+                     last_component (program_name));
 #endif
     }
 
index c4b2527e1397230b4cda4a347a4a834f03fa36e4..9b8786ebf586f1434bcb7587f5e29b0c2661c848 100644 (file)
@@ -54,7 +54,7 @@
 #include "error-progname.h"
 #include "progname.h"
 #include "relocatable.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "xerror.h"
 #include "xvasprintf.h"
 #include "xalloc.h"
@@ -680,7 +680,8 @@ main (int argc, char *argv[])
   /* Version information requested.  */
   if (do_version)
     {
-      printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+      printf ("%s (GNU %s) %s\n", last_component (program_name),
+              PACKAGE, VERSION);
       /* xgettext: no-wrap */
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <%s>\n\
@@ -805,13 +806,13 @@ xgettext cannot work without keywords to look for"));
         error (EXIT_FAILURE, 0,
                _("Cannot convert from \"%s\" to \"%s\". %s relies on iconv(), and iconv() does not support this conversion."),
                xgettext_global_source_encoding, po_charset_utf8,
-               basename (program_name));
+               last_component (program_name));
       xgettext_global_source_iconv = cd;
 #else
       error (EXIT_FAILURE, 0,
              _("Cannot convert from \"%s\" to \"%s\". %s relies on iconv(). This version was built without iconv()."),
              xgettext_global_source_encoding, po_charset_utf8,
-             basename (program_name));
+             last_component (program_name));
 #endif
     }
 
index cff65313baf35d5de3450499b3fa98817693d9c6..a706d9768f25a5cc55ef017211b11ac898e47e20 100644 (file)
@@ -32,7 +32,7 @@
 #include "error.h"
 #include "progname.h"
 #include "relocatable.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "xalloc.h"
 #include "propername.h"
 #include "xsetenv.h"
@@ -153,7 +153,8 @@ main (int argc, char *argv[])
   /* Version information is requested.  */
   if (do_version)
     {
-      printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+      printf ("%s (GNU %s) %s\n", last_component (program_name),
+              PACKAGE, VERSION);
       /* xgettext: no-wrap */
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <%s>\n\
index eef1cdee00dac0d5353670ef0bf81839b062e59e..1ef13bb41a1c7a49e54567d2838a9b1636bf567d 100644 (file)
@@ -23,6 +23,7 @@
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <locale.h>
 #include <errno.h>
 
@@ -31,7 +32,7 @@
 #include "error.h"
 #include "progname.h"
 #include "relocatable.h"
-#include "basename.h"
+#include "basename-lgpl.h"
 #include "propername.h"
 #include "xsetenv.h"
 
@@ -129,7 +130,8 @@ main (int argc, char *argv[])
   /* Version information is requested.  */
   if (do_version)
     {
-      printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+      printf ("%s (GNU %s) %s\n", last_component (program_name),
+              PACKAGE, VERSION);
       /* xgettext: no-wrap */
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <%s>\n\
index f89e003f52b5dec997e47ca00c93563e3c75277e..298c4f6045e68584a3c559afff11878eff2f0e62 100644 (file)
@@ -24,8 +24,6 @@ lib/alloca.in.h \
 lib/argmatch.h.diff \
 lib/backupfile.c \
 lib/backupfile.h \
-lib/basename.c \
-lib/basename.h \
 lib/closeout.c \
 lib/closeout.h \
 lib/diffseq.h.diff \
@@ -158,7 +156,6 @@ m4/backupfile.m4 \
 m4/java.m4 \
 m4/libxml.m4 \
 modules/backupfile \
-modules/basename \
 modules/closeout \
 modules/error-progname \
 modules/gettext-runtime-misc \
index f76eef81629ebefac1e5a8a06e4e5a95fb4cf074..074dd04c0d2c722a5a392954242cfcac53e05625 100644 (file)
@@ -1,5 +1,5 @@
 /* addext.c -- add an extension to a file name
-   Copyright (C) 1990, 1997-1999, 2001-2003, 2005-2006 Free Software
+   Copyright (C) 1990, 1997-1999, 2001-2003, 2005-2006, 2020 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -42,7 +42,7 @@
 
 #include <unistd.h>
 
-#include "basename.h"
+#include "basename-lgpl.h"
 
 /* Append to FILENAME the extension EXT, unless the result would be too long,
    in which case just append the character E.  */
@@ -50,7 +50,7 @@
 void
 addext (char *filename, char const *ext, char e)
 {
-  char *s = basename (filename);
+  char *s = last_component (filename);
   size_t slen = strlen (s), extlen = strlen (ext);
   long slen_max = -1;
 
index 624092c4611d66ac9b6073e1f9564c75e1be5f60..15595c16a4a2f6c4e0e0b68b15b8aa5e735f0841 100644 (file)
@@ -1,5 +1,5 @@
 /* backupfile.c -- make Emacs style backup file names
-   Copyright (C) 1990-2003, 2005-2006, 2012 Free Software Foundation, Inc.
+   Copyright (C) 1990-2003, 2005-2006, 2012, 2020 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -36,7 +36,7 @@
 
 #include <stdlib.h>
 
-#include "basename.h"
+#include "basename-lgpl.h"
 
 #if HAVE_DIRENT_H
 # define HAVE_DIR 1
@@ -105,7 +105,7 @@ find_backup_file_name (const char *file, enum backup_type backup_type)
       if (backup_type != simple)
         {
           int highest_backup;
-          size_t dir_len = basename (s) - s;
+          size_t dir_len = last_component (s) - s;
 
           strcpy (s + dir_len, ".");
           highest_backup = max_backup_version (file + dir_len, s);
diff --git a/gnulib-local/lib/basename.c b/gnulib-local/lib/basename.c
deleted file mode 100644 (file)
index e1da9ab..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/* Return the name-within-directory of a file name.
-   Copyright (C) 1996-2002, 2004, 2006, 2010, 2012, 2018 Free Software Foundation, Inc.
-
-   NOTE: The canonical source of this file is maintained with the GNU C Library.
-   Bugs can be reported to bug-glibc@gnu.org.
-
-   This program is free software: you can redistribute it and/or modify it
-   under the terms of the GNU General Public License as published by the
-   Free Software Foundation; either version 3 of the License, or any
-   later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
-
-#include <config.h>
-
-/* Specification.  */
-#include "basename.h"
-
-#if !(__GLIBC__ >= 2 || defined __UCLIBC__)
-
-#include <stdio.h>
-#include <assert.h>
-
-#if defined _WIN32 || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
-  /* Win32, Cygwin, OS/2, DOS */
-# define HAS_DEVICE(P) \
-    ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
-     && (P)[1] == ':')
-# define FILE_SYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0)
-# define ISSLASH(C) ((C) == '/' || (C) == '\\')
-#endif
-
-#ifndef FILE_SYSTEM_PREFIX_LEN
-# define FILE_SYSTEM_PREFIX_LEN(Filename) 0
-#endif
-
-#ifndef ISSLASH
-# define ISSLASH(C) ((C) == '/')
-#endif
-
-#ifndef _LIBC
-/* We cannot generally use the name 'basename' since XPG defines an unusable
-   variant of the function but we cannot use it.  */
-# undef basename
-# define basename gnu_basename
-#endif
-
-/* In general, we can't use the builtin 'basename' function if available,
-   since it has different meanings in different environments.
-   In some environments the builtin 'basename' modifies its argument.
-   If NAME is all slashes, be sure to return '/'.  */
-
-char *
-basename (char const *name)
-{
-  char const *base = name += FILE_SYSTEM_PREFIX_LEN (name);
-  int all_slashes = 1;
-  char const *p;
-
-  for (p = name; *p; p++)
-    {
-      if (ISSLASH (*p))
-        base = p + 1;
-      else
-        all_slashes = 0;
-    }
-
-  /* If NAME is all slashes, arrange to return '/'.  */
-  if (*base == '\0' && ISSLASH (*name) && all_slashes)
-    --base;
-
-  /* Make sure the last byte is not a slash.  */
-  assert (all_slashes || !ISSLASH (*(p - 1)));
-
-  return (char *) base;
-}
-
-#endif
diff --git a/gnulib-local/lib/basename.h b/gnulib-local/lib/basename.h
deleted file mode 100644 (file)
index c1345b9..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Pathname hacking.
-   Copyright (C) 2001-2003, 2010 Free Software Foundation, Inc.
-   Written by Bruno Haible <haible@clisp.cons.org>, 2001.
-
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
-
-#ifndef _BASENAME_H
-#define _BASENAME_H
-
-/* This is where basename() is declared.  */
-#include <string.h>
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#if !(__GLIBC__ >= 2 || defined __UCLIBC__)
-/* When not using the GNU libc we use the basename implementation we
-   provide here.  */
-extern char *gnu_basename (const char *);
-#define basename(Arg) gnu_basename (Arg)
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* _BASENAME_H */
index 0f0288a4ff23c6c039ddb38873d59b3bb1ee48d5..f7000788782e00199d96cb209d0c57f6198a6384 100644 (file)
@@ -9,7 +9,7 @@ m4/backupfile.m4
 
 Depends-on:
 argmatch
-basename
+basename-lgpl
 closedir
 opendir
 readdir
diff --git a/gnulib-local/modules/basename b/gnulib-local/modules/basename
deleted file mode 100644 (file)
index 359a126..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-Description:
-Return the name-within-directory of a file name.
-
-Files:
-lib/basename.h
-lib/basename.c
-
-Depends-on:
-
-configure.ac:
-
-Makefile.am:
-lib_SOURCES += basename.h basename.c
-
-Include:
-"basename.h"
-
-License:
-GPL
-
-Maintainer:
-Bruno Haible
-