* 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.
/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
# In gettext-runtime:
GNULIB_MODULES_RUNTIME_FOR_SRC='
atexit
- basename
+ basename-lgpl
binary-io
closeout
error
alloca-opt
atexit
backupfile
- basename
+ basename-lgpl
binary-io
bison
bison-i18n
# 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
#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"
/* 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\
#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"
/* 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\
#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"
/* 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\
# include <config.h>
#endif
-#include "basename.h"
+#include "basename-lgpl.h"
#include "cldr-plural-exp.h"
#include "closeout.h"
#include "c-ctype.h"
/* 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\
#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"
/* 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\
/* Specification. */
#include "locating-rule.h"
-#include "basename.h"
+#include "basename-lgpl.h"
#include "concat-filename.h"
#include "c-strcase.h"
&& 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;
#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"
/* 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\
#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"
/* 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\
#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"
/* 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\
#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"
/* 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\
#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"
/* 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\
#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"
/* 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\
#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"
/* 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\
#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"
/* 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\
#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"
/* 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\
#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"
/* 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\
#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"
/* 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\
/* 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.
#include "xalloc.h"
#include "xmalloca.h"
#include "c-strstr.h"
-#include "basename.h"
+#include "basename-lgpl.h"
#include "gettext.h"
#define _(str) gettext (str)
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;
/* 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
#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"
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\
- 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))
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;
}
}
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)));
}
#include "noreturn.h"
#include "progname.h"
-#include "basename.h"
+#include "basename-lgpl.h"
#include "message.h"
#include "po-charset.h"
#include "xstriconv.h"
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;
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
}
#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"
/* 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\
#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"
/* 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\
#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"
/* 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\
/* 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
#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"
# if IN_LIBGETTEXTPO
progname = "libgettextpo";
# else
- progname = basename (program_name);
+ progname = last_component (program_name);
# endif
warning_message =
# if IN_LIBGETTEXTPO
progname = "libgettextpo";
# else
- progname = basename (program_name);
+ progname = last_component (program_name);
# endif
warning_message =
#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"
/* 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\
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;
#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
}
#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"
/* 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\
#include "error.h"
#include "error-progname.h"
#include "progname.h"
-#include "basename.h"
#include "xerror.h"
#include "xvasprintf.h"
#include "xalloc.h"
#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"
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
}
#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"
/* 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\
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
}
#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"
/* 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\
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <locale.h>
#include <errno.h>
#include "error.h"
#include "progname.h"
#include "relocatable.h"
-#include "basename.h"
+#include "basename-lgpl.h"
#include "propername.h"
#include "xsetenv.h"
/* 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\
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 \
m4/java.m4 \
m4/libxml.m4 \
modules/backupfile \
-modules/basename \
modules/closeout \
modules/error-progname \
modules/gettext-runtime-misc \
/* 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
#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. */
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;
/* 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
#include <stdlib.h>
-#include "basename.h"
+#include "basename-lgpl.h"
#if HAVE_DIRENT_H
# define HAVE_DIR 1
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);
+++ /dev/null
-/* 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
+++ /dev/null
-/* 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 */
Depends-on:
argmatch
-basename
+basename-lgpl
closedir
opendir
readdir
+++ /dev/null
-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
-