From 2b83a2a4d978012cdf78b648337c31091e20526d Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 18 May 1995 09:00:09 +0000 Subject: Wed May 17 16:50:21 1995 Roland McGrath 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 * locale/loadlocale.c: Expect macro LOCALE_PATH to be defined, instead of hard-coding "/share/locale". --- locale/loadlocale.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'locale/loadlocale.c') 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; -- cgit 1.4.1