]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Update after gnulib changed.
authorBruno Haible <bruno@clisp.org>
Sat, 30 Mar 2019 11:05:10 +0000 (12:05 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 30 Mar 2019 11:35:12 +0000 (12:35 +0100)
gettext-runtime/intl/localename.c
gettext-runtime/intl/relocatable.c
gettext-runtime/intl/vasnprintf.c
gettext-runtime/intl/verify.h
gettext-runtime/libasprintf/vasnprintf.c

index 857a76d729efa2ed9a8b8651cb892419a979fb5f..1cb0a90f0df25f096b271b7994053ff1f91e1957 100644 (file)
@@ -2296,8 +2296,8 @@ gl_locale_name_from_win32_LANGID (LANGID langid)
           }
         return "wen";
       case LANG_SOTHO:
-        /* <https://msdn.microsoft.com/en-us/library/dd318693.aspx> calls
-           it "Sesotho sa Leboa"; according to
+        /* <https://docs.microsoft.com/en-us/windows/desktop/Intl/language-identifier-constants-and-strings>
+           calls it "Sesotho sa Leboa"; according to
            <https://www.ethnologue.com/show_language.asp?code=nso>
            <https://www.ethnologue.com/show_language.asp?code=sot>
            it's the same as Northern Sotho.  */
index 5960608bbd014a557ff6dbddae46c1e49f7112ad..afb1a276b98a832036922f838a83233912f47f77 100644 (file)
@@ -1,5 +1,5 @@
 /* Provide relocatable packages.
-   Copyright (C) 2003-2006, 2008-2018 Free Software Foundation, Inc.
+   Copyright (C) 2003-2006, 2008-2019 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2003.
 
    This program is free software: you can redistribute it and/or modify
@@ -268,7 +268,7 @@ compute_curr_prefix (const char *orig_installprefix,
           }
         if (!same)
           break;
-        /* The last pathname component was the same.  opi and cpi now point
+        /* The last pathname component was the same.  rpi and cpi now point
            to the slash before it.  */
         rp = rpi;
         cp = cpi;
@@ -282,23 +282,23 @@ compute_curr_prefix (const char *orig_installprefix,
       }
 
     {
-      size_t curr_prefix_len = cp - curr_installdir;
-      char *curr_prefix;
+      size_t computed_curr_prefix_len = cp - curr_installdir;
+      char *computed_curr_prefix;
 
-      curr_prefix = (char *) xmalloc (curr_prefix_len + 1);
+      computed_curr_prefix = (char *) xmalloc (computed_curr_prefix_len + 1);
 #ifdef NO_XMALLOC
-      if (curr_prefix == NULL)
+      if (computed_curr_prefix == NULL)
         {
           free (curr_installdir);
           return NULL;
         }
 #endif
-      memcpy (curr_prefix, curr_installdir, curr_prefix_len);
-      curr_prefix[curr_prefix_len] = '\0';
+      memcpy (computed_curr_prefix, curr_installdir, computed_curr_prefix_len);
+      computed_curr_prefix[computed_curr_prefix_len] = '\0';
 
       free (curr_installdir);
 
-      return curr_prefix;
+      return computed_curr_prefix;
     }
   }
 }
index 423db91b327649b2e68b8ee176561d7010c347e6..02daf987ece5a4f956af1fe8f0e27f2eebad5af2 100644 (file)
@@ -1,5 +1,5 @@
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 1999, 2002-2018 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002-2019 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
@@ -4874,6 +4874,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 # if ! (((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3))        \
          && !defined __UCLIBC__)                                            \
         || (defined __APPLE__ && defined __MACH__)                          \
+        || defined __ANDROID__                                              \
         || (defined _WIN32 && ! defined __CYGWIN__))
                 fbp[1] = '%';
                 fbp[2] = 'n';
@@ -4895,6 +4896,14 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                    On Mac OS X 10.13 or newer, the use of %n in format strings
                    in writable memory by default crashes the program, so we
                    should avoid it in this situation.  */
+                /* On Android, we know that snprintf's return value conforms to
+                   ISO C 99: the tests gl_SNPRINTF_RETVAL_C99 and
+                   gl_SNPRINTF_TRUNCATION_C99 pass.
+                   Therefore we can avoid using %n in this situation.
+                   Starting on 2018-03-07, the use of %n in format strings
+                   produces a fatal error (see
+                   <https://android.googlesource.com/platform/bionic/+/41398d03b7e8e0dfb951660ae713e682e9fc0336>),
+                   so we should avoid it.  */
                 /* On native Windows systems (such as mingw), we can avoid using
                    %n because:
                      - Although the gl_SNPRINTF_TRUNCATION_C99 test fails,
@@ -4908,7 +4917,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                    Windows Vista, the use of %n in format strings by default
                    crashes the program. See
                      <https://gcc.gnu.org/ml/gcc/2007-06/msg00122.html> and
-                     <https://msdn.microsoft.com/en-us/library/ms175782.aspx>
+                     <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/set-printf-count-output>
                    So we should avoid %n in this situation.  */
                 fbp[1] = '\0';
 # endif
index 36354359f301ee38bc95c2a23e570973b1d30600..ecd8cdb096b2a0b48057c92c35f9683a3aabdee0 100644 (file)
@@ -26,7 +26,7 @@
    here generates easier-to-read diagnostics when verify (R) fails.
 
    Define _GL_HAVE_STATIC_ASSERT to 1 if static_assert works as per C++11.
-   This will likely be supported by future GCC versions, in C++ mode.
+   This is supported by GCC 6.1.0 and later, in C++ mode.
 
    Use this only with GCC.  If we were willing to slow 'configure'
    down we could also use it with other compilers, but since this
@@ -36,9 +36,7 @@
      && !defined __cplusplus)
 # define _GL_HAVE__STATIC_ASSERT 1
 #endif
-/* The condition (99 < __GNUC__) is temporary, until we know about the
-   first G++ release that supports static_assert.  */
-#if (99 < __GNUC__) && defined __cplusplus
+#if (6 <= __GNUC__) && defined __cplusplus
 # define _GL_HAVE_STATIC_ASSERT 1
 #endif
 
index 423db91b327649b2e68b8ee176561d7010c347e6..02daf987ece5a4f956af1fe8f0e27f2eebad5af2 100644 (file)
@@ -1,5 +1,5 @@
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 1999, 2002-2018 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002-2019 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
@@ -4874,6 +4874,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 # if ! (((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3))        \
          && !defined __UCLIBC__)                                            \
         || (defined __APPLE__ && defined __MACH__)                          \
+        || defined __ANDROID__                                              \
         || (defined _WIN32 && ! defined __CYGWIN__))
                 fbp[1] = '%';
                 fbp[2] = 'n';
@@ -4895,6 +4896,14 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                    On Mac OS X 10.13 or newer, the use of %n in format strings
                    in writable memory by default crashes the program, so we
                    should avoid it in this situation.  */
+                /* On Android, we know that snprintf's return value conforms to
+                   ISO C 99: the tests gl_SNPRINTF_RETVAL_C99 and
+                   gl_SNPRINTF_TRUNCATION_C99 pass.
+                   Therefore we can avoid using %n in this situation.
+                   Starting on 2018-03-07, the use of %n in format strings
+                   produces a fatal error (see
+                   <https://android.googlesource.com/platform/bionic/+/41398d03b7e8e0dfb951660ae713e682e9fc0336>),
+                   so we should avoid it.  */
                 /* On native Windows systems (such as mingw), we can avoid using
                    %n because:
                      - Although the gl_SNPRINTF_TRUNCATION_C99 test fails,
@@ -4908,7 +4917,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                    Windows Vista, the use of %n in format strings by default
                    crashes the program. See
                      <https://gcc.gnu.org/ml/gcc/2007-06/msg00122.html> and
-                     <https://msdn.microsoft.com/en-us/library/ms175782.aspx>
+                     <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/set-printf-count-output>
                    So we should avoid %n in this situation.  */
                 fbp[1] = '\0';
 # endif