]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Update after gnulib changed.
authorBruno Haible <bruno@clisp.org>
Sat, 28 Mar 2020 19:03:44 +0000 (20:03 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 13 Apr 2020 08:20:42 +0000 (10:20 +0200)
* gnulib-local/lib/regex_internal.h.diff: Update.
* gnulib-local/lib/unistd.in.h.diff: Update.
* gettext-runtime/intl/filename.h: New file, from gnulib.
* gettext-runtime/intl/dcigettext.c (ISSLASH, HAS_DEVICE, IS_ABSOLUTE_PATH,
IS_PATH_WITH_DIR): Remove macros. Instead, include filename.h.
(IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME, IS_FILE_NAME_WITH_DIR): New
macros.
(DCIGETTEXT): Use IS_RELATIVE_FILE_NAME, IS_FILE_NAME_WITH_DIR.
* gettext-runtime/intl/l10nflist.c (ISSLASH, HAS_DEVICE, IS_ABSOLUTE_PATH):
Remove macros. Instead, include filename.h.
(IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): New macros.
(_nl_make_l10nflist): Use IS_RELATIVE_FILE_NAME.
* gettext-runtime/intl/Makefile.am (EXTRA_DIST): Add filename.h.
(l10nflist.lo, dcigettext.lo): Depend on it.
* Makefile.am (distcheck-hook): Check also gettext-runtime/intl/filename.h.
* gettext-runtime/intl/lock.c: Update from gnulib.
* gettext-runtime/intl/lock.h: Likewise.
* gettext-runtime/intl/relocatable.c: Likewise.
* gettext-tools/src/locating-rule.c (locating_rule_list_locate): Use
IS_RELATIVE_FILE_NAME instead of IS_ABSOLUTE_PATH.
* gettext-tools/src/open-catalog.c (try_open_catalog_file): Likewise.
* gettext-tools/src/xgettext.c (main, xgettext_open): Likewise.
* libtextstyle/lib/color.c (style_file_lookup): Use IS_FILE_NAME_WITH_DIR
instead of IS_PATH_WITH_DIR.

16 files changed:
.gitignore
Makefile.am
gettext-runtime/intl/Makefile.am
gettext-runtime/intl/dcigettext.c
gettext-runtime/intl/filename.h [new file with mode: 0644]
gettext-runtime/intl/l10nflist.c
gettext-runtime/intl/lock.c
gettext-runtime/intl/lock.h
gettext-runtime/intl/relocatable.c
gettext-tools/src/locating-rule.c
gettext-tools/src/open-catalog.c
gettext-tools/src/xgettext.c
gnulib-local/lib/regex_internal.h.diff
gnulib-local/lib/unistd.in.h.diff
libtextstyle/.gitignore
libtextstyle/lib/color.c

index 593ca1f518e1bddd124bd853c5ba69a73ab99176..96a3b8bf981c7f3c8611bb25e11d110c7fe4abb2 100644 (file)
 /gettext-tools/libgettextpo/intprops.h
 /gettext-tools/libgettextpo/inttypes.in.h
 /gettext-tools/libgettextpo/itold.c
+/gettext-tools/libgettextpo/lc-charset-dispatch.c
+/gettext-tools/libgettextpo/lc-charset-dispatch.h
 /gettext-tools/libgettextpo/libunistring.valgrind
 /gettext-tools/libgettextpo/limits.in.h
 /gettext-tools/libgettextpo/localcharset.c
 /gettext-tools/libgettextpo/markup.c
 /gettext-tools/libgettextpo/markup.h
 /gettext-tools/libgettextpo/mbrtowc.c
+/gettext-tools/libgettextpo/mbrtowc-impl.h
+/gettext-tools/libgettextpo/mbrtowc-impl-utf8.h
 /gettext-tools/libgettextpo/mbsinit.c
 /gettext-tools/libgettextpo/mbswidth.c
 /gettext-tools/libgettextpo/mbswidth.h
+/gettext-tools/libgettextpo/mbtowc-lock.c
+/gettext-tools/libgettextpo/mbtowc-lock.h
 /gettext-tools/libgettextpo/memchr.c
 /gettext-tools/libgettextpo/memchr.valgrind
 /gettext-tools/libgettextpo/minmax.h
index 7a854fe0691a3f005e0b29d28b98f73d00dfc4dc..be8a2c92819761509e49feb9c88374e782bc36fe 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile for the toplevel directory of GNU gettext
-## Copyright (C) 1995-2019 Free Software Foundation, Inc.
+## Copyright (C) 1995-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
@@ -86,6 +86,7 @@ distcheck-hook:
        cmp -s $(srcdir)/gettext-runtime/m4/xsize.m4 $(srcdir)/gettext-tools/gnulib-m4/xsize.m4
        cmp -s $(srcdir)/gettext-runtime/libasprintf/gnulib-m4/intmax_t.m4 $(srcdir)/gettext-tools/gnulib-m4/intmax_t.m4
        test "`sed 1,16d $(srcdir)/gettext-runtime/intl/arg-nonnull.h | md5sum`" = "`sed 1,16d $(srcdir)/gettext-tools/gnulib-lib/arg-nonnull.h | md5sum`"
+       test "`sed 1,15d $(srcdir)/gettext-runtime/intl/filename.h | md5sum`" = "`sed 1,15d $(srcdir)/gettext-tools/gnulib-lib/filename.h | md5sum`"
        test "`sed 1,16d $(srcdir)/gettext-runtime/intl/flexmember.h | md5sum`" = "`sed 1,19d $(srcdir)/gettext-tools/gnulib-lib/flexmember.h | md5sum`"
        test "`sed 1,16d $(srcdir)/gettext-runtime/intl/localcharset.h | md5sum`" = "`sed 1,16d $(srcdir)/gettext-tools/gnulib-lib/localcharset.h | md5sum`"
        test "`sed 1,16d $(srcdir)/gettext-runtime/intl/localcharset.c | md5sum`" = "`sed 1,16d $(srcdir)/gettext-tools/gnulib-lib/localcharset.c | md5sum`"
index 3a58a8202a7b1dd2509fc15cd5e2059304fd3960..4c11c9fca6a3bada7e23d0ed30df050d8a05b6a8 100644 (file)
@@ -1,6 +1,6 @@
 ## Makefile for the gettext-runtime/intl and gettext-tools/intl subdirectories
 ## of GNU gettext.
-## Copyright (C) 1995-1998, 2000-2007, 2009-2019 Free Software Foundation, Inc.
+## Copyright (C) 1995-1998, 2000-2007, 2009-2020 Free Software Foundation, Inc.
 ##
 ## This program is free software: you can redistribute it and/or modify
 ## it under the terms of the GNU Lesser General Public License as published by
@@ -84,6 +84,7 @@ EXTRA_DIST += \
   lock.h windows-mutex.h windows-rwlock.h windows-recmutex.h windows-once.h windows-initguard.h \
   relocatable.h \
   arg-nonnull.h \
+  filename.h \
   flexmember.h \
   localename-table.in.h \
   setlocale_null.h \
@@ -314,9 +315,9 @@ hash-string.lo:      ../config.h $(srcdir)/hash-string.h
 loadmsgcat.lo:       ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h $(srcdir)/hash-string.h $(srcdir)/plural-exp.h
 localealias.lo:      ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h $(srcdir)/relocatable.h
 textdomain.lo:       ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h
-l10nflist.lo:        ../config.h $(srcdir)/loadinfo.h
+l10nflist.lo:        ../config.h $(srcdir)/loadinfo.h $(srcdir)/filename.h
 explodename.lo:      ../config.h $(srcdir)/loadinfo.h
-dcigettext.lo:       ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h $(srcdir)/localcharset.h $(srcdir)/plural-exp.h $(srcdir)/hash-string.h $(srcdir)/tsearch.h $(srcdir)/tsearch.c $(srcdir)/eval-plural.h
+dcigettext.lo:       ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h $(srcdir)/localcharset.h $(srcdir)/plural-exp.h $(srcdir)/hash-string.h $(srcdir)/tsearch.h $(srcdir)/tsearch.c $(srcdir)/eval-plural.h $(srcdir)/filename.h
 dcngettext.lo:       ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h
 dngettext.lo:        ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h
 ngettext.lo:         ../config.h $(srcdir)/gettextP.h libgnuintl.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h $(srcdir)/lock.h $(srcdir)/windows-mutex.h $(srcdir)/windows-rwlock.h $(srcdir)/windows-recmutex.h $(srcdir)/windows-once.h $(srcdir)/windows-initguard.h
index f73f8dbe16b91ccc132fecd02fc4d3f3052a0aa0..267e4253614796f8b4c92dea2502e8a9d4ad3fbb 100644 (file)
@@ -1,5 +1,5 @@
 /* Implementation of the internal dcigettext function.
-   Copyright (C) 1995-2019 Free Software Foundation, Inc.
+   Copyright (C) 1995-2020 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -203,26 +203,12 @@ static void *mempcpy (void *dest, const void *src, size_t n);
 # define PATH_MAX _POSIX_PATH_MAX
 #endif
 
-/* Pathname support.
-   ISSLASH(C)           tests whether C is a directory separator character.
-   IS_ABSOLUTE_PATH(P)  tests whether P is an absolute path.  If it is not,
-                        it may be concatenated to a directory pathname.
-   IS_PATH_WITH_DIR(P)  tests whether P contains a directory specification.
- */
-#if defined _WIN32 || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
-  /* Win32, Cygwin, OS/2, DOS */
-# define ISSLASH(C) ((C) == '/' || (C) == '\\')
-# define HAS_DEVICE(P) \
-    ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
-     && (P)[1] == ':')
-# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P))
-# define IS_PATH_WITH_DIR(P) \
-    (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P))
+#ifdef _LIBC
+# define IS_ABSOLUTE_FILE_NAME(P) ((P)[0] == '/')
+# define IS_RELATIVE_FILE_NAME(P) (! IS_ABSOLUTE_FILE_NAME (P))
+# define IS_FILE_NAME_WITH_DIR(P) (strchr ((P), '/') != NULL)
 #else
-  /* Unix */
-# define ISSLASH(C) ((C) == '/')
-# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0])
-# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL)
+# include "filename.h"
 #endif
 
 /* Whether to support different locales in different threads.  */
@@ -620,7 +606,7 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
     {
       dirname = binding->dirname;
 #endif
-      if (!IS_ABSOLUTE_PATH (dirname))
+      if (IS_RELATIVE_FILE_NAME (dirname))
        {
          /* We have a relative path.  Make it absolute now.  */
          size_t dirname_len = strlen (dirname) + 1;
@@ -706,7 +692,7 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
 
          /* When this is a SUID binary we must not allow accessing files
             outside the dedicated directories.  */
-         if (ENABLE_SECURE && IS_PATH_WITH_DIR (single_locale))
+         if (ENABLE_SECURE && IS_FILE_NAME_WITH_DIR (single_locale))
            /* Ingore this entry.  */
            continue;
        }
diff --git a/gettext-runtime/intl/filename.h b/gettext-runtime/intl/filename.h
new file mode 100644 (file)
index 0000000..0135312
--- /dev/null
@@ -0,0 +1,110 @@
+/* Basic filename support macros.
+   Copyright (C) 2001-2004, 2007-2020 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* From Paul Eggert and Jim Meyering.  */
+
+#ifndef _FILENAME_H
+#define _FILENAME_H
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Filename support.
+   ISSLASH(C)                  tests whether C is a directory separator
+                               character.
+   HAS_DEVICE(Filename)        tests whether Filename contains a device
+                               specification.
+   FILE_SYSTEM_PREFIX_LEN(Filename)  length of the device specification
+                                     at the beginning of Filename,
+                                     index of the part consisting of
+                                     alternating components and slashes.
+   FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+                               1 when a non-empty device specification
+                               can be followed by an empty or relative
+                               part,
+                               0 when a non-empty device specification
+                               must be followed by a slash,
+                               0 when device specification don't exist.
+   IS_ABSOLUTE_FILE_NAME(Filename)
+                               tests whether Filename is independent of
+                               any notion of "current directory".
+   IS_RELATIVE_FILE_NAME(Filename)
+                               tests whether Filename may be concatenated
+                               to a directory filename.
+   Note: On native Windows, OS/2, DOS, "c:" is neither an absolute nor a
+   relative file name!
+   IS_FILE_NAME_WITH_DIR(Filename)  tests whether Filename contains a device
+                                    or directory specification.
+ */
+#if defined _WIN32 || defined __CYGWIN__ \
+    || defined __EMX__ || defined __MSDOS__ || defined __DJGPP__
+  /* Native Windows, Cygwin, OS/2, DOS */
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+  /* Internal macro: Tests whether a character is a drive letter.  */
+# define _IS_DRIVE_LETTER(C) \
+    (((C) >= 'A' && (C) <= 'Z') || ((C) >= 'a' && (C) <= 'z'))
+  /* Help the compiler optimizing it.  This assumes ASCII.  */
+# undef _IS_DRIVE_LETTER
+# define _IS_DRIVE_LETTER(C) \
+    (((unsigned int) (C) | ('a' - 'A')) - 'a' <= 'z' - 'a')
+# define HAS_DEVICE(Filename) \
+    (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':')
+# define FILE_SYSTEM_PREFIX_LEN(Filename) (HAS_DEVICE (Filename) ? 2 : 0)
+# ifdef __CYGWIN__
+#  define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
+# else
+   /* On native Windows, OS/2, DOS, the system has the notion of a
+      "current directory" on each drive.  */
+#  define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1
+# endif
+# if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+#  define IS_ABSOLUTE_FILE_NAME(Filename) \
+     ISSLASH ((Filename)[FILE_SYSTEM_PREFIX_LEN (Filename)])
+# else
+#  define IS_ABSOLUTE_FILE_NAME(Filename) \
+     (ISSLASH ((Filename)[0]) || HAS_DEVICE (Filename))
+# endif
+# define IS_RELATIVE_FILE_NAME(Filename) \
+    (! (ISSLASH ((Filename)[0]) || HAS_DEVICE (Filename)))
+# define IS_FILE_NAME_WITH_DIR(Filename) \
+    (strchr ((Filename), '/') != NULL || strchr ((Filename), '\\') != NULL \
+     || HAS_DEVICE (Filename))
+#else
+  /* Unix */
+# define ISSLASH(C) ((C) == '/')
+# define HAS_DEVICE(Filename) ((void) (Filename), 0)
+# define FILE_SYSTEM_PREFIX_LEN(Filename) ((void) (Filename), 0)
+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
+# define IS_ABSOLUTE_FILE_NAME(Filename) ISSLASH ((Filename)[0])
+# define IS_RELATIVE_FILE_NAME(Filename) (! ISSLASH ((Filename)[0]))
+# define IS_FILE_NAME_WITH_DIR(Filename) (strchr ((Filename), '/') != NULL)
+#endif
+
+/* Deprecated macros.  For backward compatibility with old users of the
+   'filename' module.  */
+#define IS_ABSOLUTE_PATH IS_ABSOLUTE_FILE_NAME
+#define IS_PATH_WITH_DIR IS_FILE_NAME_WITH_DIR
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _FILENAME_H */
index 95667ca7f659537a6edc3c485f1db4090b11be20..7d3c9690c12337b9e882acc2f2ecd7f8b24d9ab1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-2016, 2018 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2016, 2018, 2020 Free Software Foundation, Inc.
    Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
 
    This program is free software: you can redistribute it and/or modify
@@ -60,22 +60,11 @@ static char *stpcpy (char *dest, const char *src);
 # endif
 #endif
 
-/* Pathname support.
-   ISSLASH(C)           tests whether C is a directory separator character.
-   IS_ABSOLUTE_PATH(P)  tests whether P is an absolute path.  If it is not,
-                        it may be concatenated to a directory pathname.
- */
-#if defined _WIN32 || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
-  /* Win32, Cygwin, OS/2, DOS */
-# define ISSLASH(C) ((C) == '/' || (C) == '\\')
-# define HAS_DEVICE(P) \
-    ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
-     && (P)[1] == ':')
-# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P))
+#ifdef _LIBC
+# define IS_ABSOLUTE_FILE_NAME(P) ((P)[0] == '/')
+# define IS_RELATIVE_FILE_NAME(P) (! IS_ABSOLUTE_FILE_NAME (P))
 #else
-  /* Unix */
-# define ISSLASH(C) ((C) == '/')
-# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0])
+# include "filename.h"
 #endif
 
 /* Define function which are usually not available.  */
@@ -183,7 +172,7 @@ _nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list,
 
   /* If LANGUAGE contains an absolute directory specification, we ignore
      DIRLIST.  */
-  if (IS_ABSOLUTE_PATH (language))
+  if (!IS_RELATIVE_FILE_NAME (language))
     dirlist_len = 0;
 
   /* Allocate room for the full file name.  */
index 4755c6909d18583a5e1180072b4fe9cf5fda0aae..f509e217e1755a908a73efaac1228f3289754094 100644 (file)
@@ -1,5 +1,5 @@
 /* Locking in multithreaded situations.
-   Copyright (C) 2005-2008, 2012, 2017, 2019 Free Software Foundation, Inc.
+   Copyright (C) 2005-2008, 2012, 2017, 2019-2020 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -718,6 +718,26 @@ glthread_once_singlethreaded (pthread_once_t *once_control)
     return 0;
 }
 
+# if !(PTHREAD_IN_USE_DETECTION_HARD || USE_POSIX_THREADS_WEAK)
+
+int
+glthread_once_multithreaded (pthread_once_t *once_control,
+                             void (*init_function) (void))
+{
+  int err = pthread_once (once_control, init_function);
+  if (err == ENOSYS)
+    {
+      /* This happens on FreeBSD 11: The pthread_once function in libc returns
+         ENOSYS.  */
+      if (glthread_once_singlethreaded (once_control))
+        init_function ();
+      return 0;
+    }
+  return err;
+}
+
+# endif
+
 #endif
 
 /* ========================================================================= */
index 017e95f7e4f8ca5dcb68ca70c4746062b5f88c1c..d65f2c033ad54b7d3d4afb9affb66eb32593514e 100644 (file)
@@ -1,5 +1,5 @@
 /* Locking in multithreaded situations.
-   Copyright (C) 2005-2008, 2017-2019 Free Software Foundation, Inc.
+   Copyright (C) 2005-2008, 2017-2020 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -505,10 +505,19 @@ extern int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *l
 typedef pthread_once_t gl_once_t;
 # define gl_once_define(STORAGECLASS, NAME) \
     STORAGECLASS pthread_once_t NAME = PTHREAD_ONCE_INIT;
-# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
-    (pthread_in_use ()                                                         \
-     ? pthread_once (ONCE_CONTROL, INITFUNCTION)                               \
-     : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0))
+# if PTHREAD_IN_USE_DETECTION_HARD || USE_POSIX_THREADS_WEAK
+#  define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+     (pthread_in_use ()                                                        \
+      ? pthread_once (ONCE_CONTROL, INITFUNCTION)                              \
+      : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0))
+# else
+#  define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+     (pthread_in_use ()                                                        \
+      ? glthread_once_multithreaded (ONCE_CONTROL, INITFUNCTION)               \
+      : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0))
+extern int glthread_once_multithreaded (pthread_once_t *once_control,
+                                        void (*init_function) (void));
+# endif
 extern int glthread_once_singlethreaded (pthread_once_t *once_control);
 
 # ifdef __cplusplus
index afb1a276b98a832036922f838a83233912f47f77..209a618e9b50f4d8ff9f61f4c9c0663836b80e78 100644 (file)
@@ -74,8 +74,8 @@
 #define true 1
 
 /* Pathname support.
-   ISSLASH(C)           tests whether C is a directory separator character.
-   IS_PATH_WITH_DIR(P)  tests whether P contains a directory specification.
+   ISSLASH(C)                tests whether C is a directory separator character.
+   IS_FILE_NAME_WITH_DIR(P)  tests whether P contains a directory specification.
  */
 #if (defined _WIN32 && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__
   /* Native Windows, OS/2, DOS */
 # define HAS_DEVICE(P) \
     ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
      && (P)[1] == ':')
-# define IS_PATH_WITH_DIR(P) \
+# define IS_FILE_NAME_WITH_DIR(P) \
     (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P))
 # define FILE_SYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0)
 #else
   /* Unix */
 # define ISSLASH(C) ((C) == '/')
-# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL)
+# define IS_FILE_NAME_WITH_DIR(P) (strchr (P, '/') != NULL)
 # define FILE_SYSTEM_PREFIX_LEN(P) 0
 #endif
 
@@ -333,7 +333,7 @@ DllMain (HINSTANCE module_handle, DWORD event, LPVOID reserved)
         /* Shouldn't happen.  */
         return FALSE;
 
-      if (!IS_PATH_WITH_DIR (location))
+      if (!IS_FILE_NAME_WITH_DIR (location))
         /* Shouldn't happen.  */
         return FALSE;
 
index f78b437ca28b3702cc4ad48e89b14d2a8ceabfcd..06e725b5aa8c91d56524393283288c2c5dec1681 100644 (file)
@@ -1,5 +1,5 @@
 /* XML resource locating rules
-   Copyright (C) 2015 Free Software Foundation, Inc.
+   Copyright (C) 2015, 2020 Free Software Foundation, Inc.
 
    This file was written by Daiki Ueno <ueno@gnu.org>, 2015.
 
@@ -194,18 +194,11 @@ locating_rule_list_locate (struct locating_rule_list_ty *rules,
                            const char *filename,
                            const char *name)
 {
-  const char *target = NULL;
   size_t i;
 
   for (i = 0; i < rules->nitems; i++)
     {
-      if (IS_ABSOLUTE_PATH (filename))
-        {
-          target = locating_rule_match (&rules->items[i], filename, name);
-          if (target != NULL)
-            return target;
-        }
-      else
+      if (IS_RELATIVE_FILE_NAME (filename))
         {
           int j;
 
@@ -213,6 +206,7 @@ locating_rule_list_locate (struct locating_rule_list_ty *rules,
             {
               const char *dir = dir_list_nth (j);
               char *new_filename;
+              const char *target;
 
               if (dir == NULL)
                 break;
@@ -225,6 +219,14 @@ locating_rule_list_locate (struct locating_rule_list_ty *rules,
                 return target;
             }
         }
+      else
+        {
+          const char *target =
+            locating_rule_match (&rules->items[i], filename, name);
+
+          if (target != NULL)
+            return target;
+        }
     }
 
   return NULL;
index 1627c9d960e77523d44b385665a56bd78f949d8d..b904886ff6a65227b291a80897ff10f27fd5fc28 100644 (file)
@@ -1,5 +1,5 @@
 /* open-po - search for .po file along search path list and open for reading
-   Copyright (C) 1995-1996, 2000-2003, 2005-2009 Free Software Foundation, Inc.
+   Copyright (C) 1995-1996, 2000-2003, 2005-2009, 2020 Free Software Foundation, Inc.
    Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, April 1995.
 
    This program is free software: you can redistribute it and/or modify
@@ -57,26 +57,8 @@ try_open_catalog_file (const char *input_name, char **real_file_name_p)
       return stdin;
     }
 
-  /* We have a real name for the input file.  If the name is absolute,
-     try the various extensions, but ignore the directory search list.  */
-  if (IS_ABSOLUTE_PATH (input_name))
-    {
-      for (k = 0; k < SIZEOF (extension); ++k)
-        {
-          file_name = xconcatenated_filename ("", input_name, extension[k]);
-
-          ret_val = fopen (file_name, "r");
-          if (ret_val != NULL || errno != ENOENT)
-            {
-              /* We found the file.  */
-              *real_file_name_p = file_name;
-              return ret_val;
-            }
-
-          free (file_name);
-        }
-    }
-  else
+  /* We have a real name for the input file.  */
+  if (IS_RELATIVE_FILE_NAME (input_name))
     {
       /* For relative file names, look through the directory search list,
          trying the various extensions.  If no directory search list is
@@ -89,6 +71,7 @@ try_open_catalog_file (const char *input_name, char **real_file_name_p)
             ret_val = fopen (file_name, "r");
             if (ret_val != NULL || errno != ENOENT)
               {
+                /* We found the file.  */
                 *real_file_name_p = file_name;
                 return ret_val;
               }
@@ -96,6 +79,25 @@ try_open_catalog_file (const char *input_name, char **real_file_name_p)
             free (file_name);
           }
     }
+  else
+    {
+      /* The name is not relative.  Try the various extensions, but ignore the
+         directory search list.  */
+      for (k = 0; k < SIZEOF (extension); ++k)
+        {
+          file_name = xconcatenated_filename ("", input_name, extension[k]);
+
+          ret_val = fopen (file_name, "r");
+          if (ret_val != NULL || errno != ENOENT)
+            {
+              /* We found the file.  */
+              *real_file_name_p = file_name;
+              return ret_val;
+            }
+
+          free (file_name);
+        }
+    }
 
   /* File does not exist.  */
   *real_file_name_p = xstrdup (input_name);
index b9cd243f59ee53881580d544958403d7b0b58e29..a6bceddcf32706a022e009c7a3af1c8909da9ab6 100644 (file)
@@ -1,5 +1,5 @@
 /* Extracts strings from C source file to Uniforum style .po file.
-   Copyright (C) 1995-1998, 2000-2016, 2018-2019 Free Software Foundation, Inc.
+   Copyright (C) 1995-1998, 2000-2016, 2018-2020 Free Software Foundation, Inc.
    Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, April 1995.
 
    This program is free software: you can redistribute it and/or modify
@@ -746,11 +746,11 @@ xgettext cannot work without keywords to look for"));
      the special name "-" we write to stdout.  */
   if (output_file)
     {
-      if (IS_ABSOLUTE_PATH (output_file) || strcmp (output_file, "-") == 0)
-        file_name = xstrdup (output_file);
-      else
+      if (IS_RELATIVE_FILE_NAME (output_file) && strcmp (output_file, "-") != 0)
         /* Please do NOT add a .po suffix! */
         file_name = xconcatenated_filename (output_dir, output_file, NULL);
+      else
+        file_name = xstrdup (output_file);
     }
   else if (strcmp (default_domain, "-") == 0)
     file_name = "-";
@@ -1700,16 +1700,7 @@ xgettext_open (const char *fn,
       logical_file_name = xstrdup (new_name);
       fp = stdin;
     }
-  else if (IS_ABSOLUTE_PATH (fn))
-    {
-      new_name = xstrdup (fn);
-      fp = fopen (fn, "r");
-      if (fp == NULL)
-        error (EXIT_FAILURE, errno,
-               _("error while opening \"%s\" for reading"), fn);
-      logical_file_name = xstrdup (new_name);
-    }
-  else
+  else if (IS_RELATIVE_FILE_NAME (fn))
     {
       int j;
 
@@ -1740,6 +1731,15 @@ xgettext_open (const char *fn,
          file name which was searched for.  */
       logical_file_name = xstrdup (fn);
     }
+  else
+    {
+      new_name = xstrdup (fn);
+      fp = fopen (fn, "r");
+      if (fp == NULL)
+        error (EXIT_FAILURE, errno,
+               _("error while opening \"%s\" for reading"), fn);
+      logical_file_name = xstrdup (new_name);
+    }
 
   *logical_file_name_p = logical_file_name;
   *real_file_name_p = new_name;
index bfcc242001fcd63b1fd3df432d2e5b50df7b2186..b546622bde942db07c890ce4595d43571b8e968d 100644 (file)
@@ -1,7 +1,7 @@
 *** lib/regex_internal.h.orig  Mon May 24 12:36:55 2010
 --- lib/regex_internal.h       Mon May 24 12:35:46 2010
 ***************
-*** 476,482 ****
+*** 468,474 ****
   # define MAX(a,b) ((a) < (b) ? (b) : (a))
   #endif
   
@@ -9,7 +9,7 @@
   #define re_realloc(p,t,n) ((t *) realloc (p, (n) * sizeof (t)))
   #define re_free(p) free (p)
   
---- 476,482 ----
+--- 468,474 ----
   # define MAX(a,b) ((a) < (b) ? (b) : (a))
   #endif
   
index 5c131cdb5997f6a91b3c661b433f9b5caa609079..d265068a624e482aee5e9a7208d053cadc689553 100644 (file)
@@ -1,14 +1,15 @@
 --- unistd.in.h        2017-05-15 19:05:30.449063823 +0200
 +++ unistd.in.h.new    2017-05-15 19:14:39.145268786 +0200
-@@ -136,6 +136,10 @@
+@@ -141,7 +141,11 @@
  
  /* Get getopt(), optarg, optind, opterr, optopt.  */
--#if @GNULIB_UNISTD_H_GETOPT@ && !defined _GL_SYSTEM_GETOPT
+-#if @GNULIB_GETOPT_POSIX@ && @GNULIB_UNISTD_H_GETOPT@ && !defined _GL_SYSTEM_GETOPT
 +/* Also, don't include <getopt.h> inside libgettextpo, because we use
 +   the getopt module only in gettext-tools/gnulib-lib/, not in
 +   gettext-tools/libgettextpo/, but there is only a single
 +   GNULIB_UNISTD_H_GETOPT variable for both.  */
-+#if @GNULIB_UNISTD_H_GETOPT@ && !defined GTPO_CONFIG_H && !defined _GL_SYSTEM_GETOPT
++#if @GNULIB_GETOPT_POSIX@ && @GNULIB_UNISTD_H_GETOPT@ && !defined GTPO_CONFIG_H && !defined _GL_SYSTEM_GETOPT
  # include <getopt-cdefs.h>
  # include <getopt-pfx-core.h>
  #endif
index 360366b0df6bdef74113d55fa4984de4d89d3d8e..96f7f07df7f7e6c90f5faa1e06fddb3eb558eb8d 100644 (file)
@@ -55,6 +55,7 @@
 /lib/float+.h
 /lib/float.c
 /lib/float.in.h
+/lib/fstat.c
 /lib/fsync.c
 /lib/full-write.c
 /lib/full-write.h
@@ -95,6 +96,8 @@
 /lib/limits.in.h
 /lib/log10.c
 /lib/malloc.c
+/lib/malloca.c
+/lib/malloca.h
 /lib/math.c
 /lib/math.in.h
 /lib/memchr.c
 /lib/obstack.h
 /lib/ostream.oo.c
 /lib/ostream.oo.h
+/lib/pathmax.h
 /lib/printf-args.c
 /lib/printf-args.h
 /lib/printf-parse.c
 /lib/sigprocmask.c
 /lib/size_max.h
 /lib/snprintf.c
+/lib/stat.c
+/lib/stat-time.c
+/lib/stat-time.h
+/lib/stat-w32.c
+/lib/stat-w32.h
 /lib/stdarg.in.h
 /lib/stdbool.in.h
 /lib/stddef.in.h
 /lib/styled-ostream.oo.c
 /lib/styled-ostream.oo.h
 /lib/sys-limits.h
+/lib/sys_stat.in.h
 /lib/sys_types.in.h
 /lib/term-ostream.oo.c
 /lib/term-ostream.oo.h
@@ -461,6 +471,8 @@ core
 /lib/stdlib.h-t
 /lib/string.h
 /lib/string.h-t
+/lib/sys/stat.h
+/lib/sys/stat.h-t
 /lib/sys/types.h
 /lib/sys/types.h-t
 /lib/textstyle/stdbool.h-t
index 5f080c9ce3f4994dec45af0df3360815e4ee8f4e..7689c1b1c7dd0dd6e5933dc8dcf22ef323dce473 100644 (file)
@@ -1,5 +1,5 @@
 /* Color and styling handling.
-   Copyright (C) 2006-2008, 2019 Free Software Foundation, Inc.
+   Copyright (C) 2006-2008, 2019-2020 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
    This program is free software: you can redistribute it and/or modify
@@ -388,7 +388,7 @@ print_color_test ()
 static const char *
 style_file_lookup (const char *file_name, const char *stylesdir_after_install)
 {
-  if (!IS_PATH_WITH_DIR (file_name))
+  if (!IS_FILE_NAME_WITH_DIR (file_name))
     {
       /* It's a file name without a directory specification.
          If it does not exist in the current directory...  */