2016-10-13 11:25:07 +02:00
|
|
|
Index: glibc-2.24/intl/loadmsgcat.c
|
2009-02-20 08:46:43 +01:00
|
|
|
===================================================================
|
2016-10-13 11:25:07 +02:00
|
|
|
--- glibc-2.24.orig/intl/loadmsgcat.c
|
|
|
|
+++ glibc-2.24/intl/loadmsgcat.c
|
|
|
|
@@ -829,8 +829,47 @@ _nl_load_domain (struct loaded_l10nfile
|
2009-02-20 08:46:43 +01:00
|
|
|
if (domain_file->filename == NULL)
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
- /* Try to open the addressed file. */
|
2014-09-15 12:37:45 +02:00
|
|
|
- fd = open (domain_file->filename, O_RDONLY | O_BINARY);
|
2009-02-20 08:46:43 +01:00
|
|
|
+ /* Replace /locale/ with /usr/share/locale-langpack/ */
|
|
|
|
+ const char *langpackdir = "/usr/share/locale-langpack/";
|
|
|
|
+ char *filename_langpack = malloc (strlen (domain_file->filename) +
|
2016-10-13 11:25:07 +02:00
|
|
|
+ strlen (langpackdir));
|
2009-02-20 08:46:43 +01:00
|
|
|
+ if (filename_langpack != NULL)
|
|
|
|
+ {
|
|
|
|
+ char *p = strstr (domain_file->filename, "/locale/");
|
|
|
|
+ if (p != NULL)
|
|
|
|
+ {
|
|
|
|
+ strcpy (filename_langpack, langpackdir);
|
2016-10-13 11:25:07 +02:00
|
|
|
+ strcpy (&filename_langpack[strlen (langpackdir)], p + 8);
|
|
|
|
+ fd = open (filename_langpack, O_RDONLY | O_BINARY);
|
2009-02-20 08:46:43 +01:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ free (filename_langpack);
|
|
|
|
+ }
|
2016-10-13 11:25:07 +02:00
|
|
|
+
|
|
|
|
+ if (fd == -1)
|
2009-02-20 08:46:43 +01:00
|
|
|
+ /* Try to open the addressed file. */
|
2014-09-15 12:37:45 +02:00
|
|
|
+ fd = open (domain_file->filename, O_RDONLY | O_BINARY);
|
2009-02-20 08:46:43 +01:00
|
|
|
+
|
|
|
|
+ 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);
|
2016-10-13 11:25:07 +02:00
|
|
|
+ strcpy (&filename_bundle[strlen (bundle_dir)], p + 8);
|
2014-09-15 12:37:45 +02:00
|
|
|
+ fd = open (filename_bundle, O_RDONLY | O_BINARY);
|
2009-02-20 08:46:43 +01:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ free (filename_bundle);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
if (fd == -1)
|
|
|
|
goto out;
|
|
|
|
|