summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/glibc-versioned-locpath.patch
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches/glibc-versioned-locpath.patch')
-rw-r--r--gnu/packages/patches/glibc-versioned-locpath.patch35
1 files changed, 13 insertions, 22 deletions
diff --git a/gnu/packages/patches/glibc-versioned-locpath.patch b/gnu/packages/patches/glibc-versioned-locpath.patch
index bc7652127f..8702531934 100644
--- a/gnu/packages/patches/glibc-versioned-locpath.patch
+++ b/gnu/packages/patches/glibc-versioned-locpath.patch
@@ -54,12 +54,12 @@ diff --git a/locale/setlocale.c b/locale/setlocale.c
index ead030d..0c0e314 100644
--- a/locale/setlocale.c
+++ b/locale/setlocale.c
-@@ -215,12 +215,65 @@ setdata (int category, struct __locale_data *data)
+@@ -215,12 +215,54 @@ setdata (int category, struct __locale_data *data)
}
}
+/* Return in *LOCALE_PATH and *LOCALE_PATH_LEN the locale data search path as
-+ a colon-separated list. Return ENOMEN on error, zero otherwise. */
++ an argz list. Return ENOMEN on error, zero otherwise. */
+error_t
+compute_locale_search_path (char **locale_path, size_t *locale_path_len)
+{
@@ -71,8 +71,8 @@ index ead030d..0c0e314 100644
+ /* Entries in 'GUIX_LOCPATH' take precedence over 'LOCPATH'. These
+ entries are systematically prefixed with "/X.Y" where "X.Y" is the
+ libc version. */
-+ if (__argz_create_sep (guix_locpath_var, ':',
-+ locale_path, locale_path_len) != 0
++ if (__argz_add_sep (locale_path, locale_path_len,
++ guix_locpath_var, ':') != 0
+ || __argz_suffix_entries (locale_path, locale_path_len,
+ "/" VERSION) != 0)
+ goto bail_out;
@@ -80,27 +80,16 @@ index ead030d..0c0e314 100644
+
+ if (locpath_var != NULL && locpath_var[0] != '\0')
+ {
-+ char *reg_locale_path = NULL;
-+ size_t reg_locale_path_len = 0;
-+
-+ if (__argz_create_sep (locpath_var, ':',
-+ &reg_locale_path, &reg_locale_path_len) != 0)
-+ goto bail_out;
-+
-+ if (__argz_append (locale_path, locale_path_len,
-+ reg_locale_path, reg_locale_path_len) != 0)
++ if (__argz_add_sep (locale_path, locale_path_len,
++ locpath_var, ':') != 0)
+ goto bail_out;
+
-+ free (reg_locale_path);
+ }
+
-+ if (*locale_path != NULL)
-+ {
-+ /* Append the system default locale directory. */
-+ if (__argz_add_sep (locale_path, locale_path_len,
-+ _nl_default_locale_path, ':') != 0)
-+ goto bail_out;
-+ }
++ /* Append the system default locale directory. */
++ if (__argz_add_sep (locale_path, locale_path_len,
++ _nl_default_locale_path, ':') != 0)
++ goto bail_out;
+
+ return 0;
+
@@ -160,7 +149,7 @@ new file mode 100644
index 0000000..505b0f2
--- /dev/null
+++ b/string/argz-suffix.c
-@@ -0,0 +1,56 @@
+@@ -0,0 +1,58 @@
+/* Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ludovic Courtès <ludo@gnu.org>.
@@ -192,6 +181,8 @@ index 0000000..505b0f2
+ size_t suffix_len = strlen (suffix);
+ size_t count = __argz_count (*argz, *argz_len);
+ size_t new_argz_len = *argz_len + count * suffix_len;
++ if (new_argz_len == 0)
++ return 0;
+ char *new_argz = malloc (new_argz_len);
+
+ if (new_argz)