about summary refs log tree commit diff
path: root/locale/loadlocale.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-05-18 09:00:09 +0000
committerRoland McGrath <roland@gnu.org>1995-05-18 09:00:09 +0000
commit2b83a2a4d978012cdf78b648337c31091e20526d (patch)
tree6a5130b031f6815b6edbbb6e2b084c79ece15b1d /locale/loadlocale.c
parent4f6dc78a9237bb327a1d694635be9b0f50cc395e (diff)
downloadglibc-2b83a2a4d978012cdf78b648337c31091e20526d.tar.gz
glibc-2b83a2a4d978012cdf78b648337c31091e20526d.tar.xz
glibc-2b83a2a4d978012cdf78b648337c31091e20526d.zip
Wed May 17 16:50:21 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
	Merged 1003.2 locale and localedef programs by Ulrich Drepper.
	* locale/charmap.c: New file.
	* locale/collate.c: New file.
	* locale/config.h: New file.
	* locale/ctype.c: New file.
	* locale/ctypedump.c: New file.
	* locale/hash.c: New file.
	* locale/hash.h: New file.
	* locale/iso-4217.def: New file.
	* locale/keyword.gperf: New file.
	* locale/keyword.h: New file.
	* locale/libintl.h: New file.
	* locale/locale.c: New file.
	* locale/localedef.c: New file.
	* locale/localedef.h: New file.
	* locale/locfile-lex.c: New file.
	* locale/locfile-parse.c: New file.
	* locale/messages.c: New file.
	* locale/monetary.c: New file.
	* locale/numeric.c: New file.
	* locale/token.h: New file.

	* posix/regex.c, posix/regex.h: New files, incorporated from GNU regex.
	* posix/Makefile (headers): Add regex.h.
	(routines): Add regex.
	(gpl2lgpl): Add regex.c and regex.h.

Tue May 16 17:35:07 1995  Roland McGrath  <roland@churchy.gnu.ai.mit.edu>

	* locale/loadlocale.c: Expect macro LOCALE_PATH to be defined,
 	instead of hard-coding "/share/locale".
Diffstat (limited to 'locale/loadlocale.c')
-rw-r--r--locale/loadlocale.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/locale/loadlocale.c b/locale/loadlocale.c
index 5073bd4be3..7e29c97205 100644
--- a/locale/loadlocale.c
+++ b/locale/loadlocale.c
@@ -69,13 +69,14 @@ _nl_load_locale (int category, char **name)
     }
 
   {
-    const char localedir[] = "/share/locale/"; /* XXX */
     const char *catname = _nl_category_names[category];
     size_t namelen = strlen (*name);
     size_t catlen = strlen (catname);
-    char file[sizeof localedir + namelen + catlen * 2 + 4];
-    sprintf (file, "%s%s/%s",
-	     strchr (*name, '/') != NULL ? "" : localedir, *name, catname);
+    char file[sizeof LOCALE_PATH + 1 + namelen + catlen * 2 + 4];
+    if (strchr (*name, '/') != NULL)
+      sprintf (file, "%s/%s", *name, catname);
+    else
+      sprintf (file, "%s/%s/%s", LOCALE_PATH, *name, catname);
     fd = __open (file, O_RDONLY);
     if (fd < 0)
       return NULL;