glibc/glibc-2.3.90-langpackdir.diff
Andreas Schwab d2f37bcdab Accepting request 249235 from home:Andreas_Schwab:glibc
- Update to glibc 2.20 release.
  * Reverted change of ABI data structures for s390 and s390x
  * Support for file description locks is added to systems running the
    Linux kernel
  * Optimized strchr implementation for AArch64
  * The minimum Linux kernel version that this version of the GNU C Library
    can be used with is 2.6.32
  * Running the testsuite no longer terminates as soon as a test fails
  * The am33 port, which had not worked for several years, has been removed
    from ports.
  * The _BSD_SOURCE and _SVID_SOURCE feature test macros are no longer
    supported; they now act the same as _DEFAULT_SOURCE (but generate a
    warning)
  * Optimized strcmp implementation for ARMv7
  * Added support for TX lock elision of pthread mutexes on s390 and s390x
  * All supported architectures now use the main glibc sysdeps directory
    instead of some being in a separate "ports" directory
  * The NPTL implementation of POSIX pthreads is no longer an "add-on"
  * Locale names, including those obtained from environment variables (LANG
    and the LC_* variables), are more tightly checked for proper syntax
  * On x86-64, the dynamic linker's lazy-binding support is now compatible
    with application code using Intel MPX instructions
- Patches from upstream removed
  * nss-dns-memleak.patch
  * sin-sign.patch
  * pldd-wait-ptrace-stop.patch
  * nscd-track-startup-failures.patch
  * powerpc-opt-power8.patch
  * check-pf-alloca.patch
  * getaddrinfo-uninit-result.patch

OBS-URL: https://build.opensuse.org/request/show/249235
OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=387
2014-09-15 10:37:45 +00:00

60 lines
1.9 KiB
Diff

Index: glibc-2.17.90/intl/loadmsgcat.c
===================================================================
--- glibc-2.17.90.orig/intl/loadmsgcat.c
+++ glibc-2.17.90/intl/loadmsgcat.c
@@ -806,8 +806,52 @@ _nl_load_domain (domain_file, domainbind
if (domain_file->filename == NULL)
goto out;
- /* Try to open the addressed file. */
- fd = open (domain_file->filename, O_RDONLY | O_BINARY);
+ /* Replace /locale/ with /usr/share/locale-langpack/ */
+ const char *langpackdir = "/usr/share/locale-langpack/";
+ char *filename_langpack = malloc (strlen (domain_file->filename) +
+ strlen (langpackdir));
+ if (filename_langpack != NULL)
+ {
+ char *p = strstr (domain_file->filename, "/locale/");
+ if (p != NULL)
+ {
+ strcpy (filename_langpack, langpackdir);
+ strcpy (&filename_langpack[strlen (langpackdir)],
+ (p+8));
+ if ((fd = open (filename_langpack, O_RDONLY | O_BINARY)) == -1)
+ fd = open (domain_file->filename, O_RDONLY | O_BINARY);
+ }
+ else
+ /* Try to open the addressed file. */
+ fd = open (domain_file->filename, O_RDONLY | O_BINARY);
+
+ free (filename_langpack);
+ }
+ else
+ /* Try to open the addressed file. */
+ fd = open (domain_file->filename, O_RDONLY | O_BINARY);
+
+ if (fd == -1)
+ {
+ /* Use the fallback directory. */
+ const char *bundle_dir = "/usr/share/locale-bundle/";
+ char *filename_bundle = malloc (strlen (domain_file->filename) +
+ strlen (bundle_dir));
+ if (filename_bundle != NULL)
+ {
+ char *p = strstr (domain_file->filename, "/locale/");
+ if (p != NULL)
+ {
+ strcpy (filename_bundle, bundle_dir);
+ strcpy (&filename_bundle[strlen (bundle_dir)],
+ (p+8));
+ fd = open (filename_bundle, O_RDONLY | O_BINARY);
+ }
+
+ free (filename_bundle);
+ }
+ }
+
if (fd == -1)
goto out;