diff options
author | Ulrich Drepper <drepper@redhat.com> | 2000-01-29 12:04:45 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2000-01-29 12:04:45 +0000 |
commit | b6aa34eb721a209444df2c0694bb18f8f4a58e47 (patch) | |
tree | 7256c643e7830c3a6aa7e852942d11d34b988d72 /catgets/open_catalog.c | |
parent | 6770573aa3190c539932fd0bd56e9b64f95065a5 (diff) | |
download | glibc-b6aa34eb721a209444df2c0694bb18f8f4a58e47.tar.gz glibc-b6aa34eb721a209444df2c0694bb18f8f4a58e47.tar.xz glibc-b6aa34eb721a209444df2c0694bb18f8f4a58e47.zip |
Update.
* locale/loadlocale.c (_nl_load_locale): Optimize a bit. Pretty print. Add checks for _POSIX_MMAPPED_FILES where necessary. (_nl_unload_locale): If locale data was mmapped use munmap. 2000-01-29 Andreas Jaeger <aj@suse.de> * sysdeps/unix/sysv/linux/i386/sys/io.h: Add missing ints, use _EXTERN_INLINE, compile inline assembler functions only with gcc. 2000-01-29 Ulrich Drepper <drepper@redhat.com> * catgets/catgets.c (catopen): Handle NL_CAT_LOCALE correctly. * catgets/gencat.c (read_input_file): Remove messages correctly. * catgets/open_catalog.c (__open_catalog): Handle trailing colons and adjacent colons correctly. Correct loops to read territory and and codeset part. Patches by Geoff Clare <gwc@unisoft.com> (PR libc/1559). * rt/aio_misc.c (get_elem): Assign pointer to new row to correct pool entry. Patch by Jens Moeller <jens.moeller@waii.com> (PR libc/1558). 2000-01-28 Jakub Jelinek <jakub@redhat.com> * sysdeps/unix/sysv/linux/arm/Versions: Export the new *rlimit interface with symbol version GLIBC_2.2. * sysdeps/unix/sysv/linux/i386/Versions: Likewise. * sysdeps/unix/sysv/linux/i386/getrlimit.c: Likewise. * sysdeps/unix/sysv/linux/i386/getrlimit64.c: Likewise. * sysdeps/unix/sysv/linux/i386/setrlimit.c: Likewise. 2000-01-27 Scott Bambrough <scottb@netwinder.org> * sysdeps/unix/sysv/linux/arm/Makefile: Backout rlimit changes for resource directory. * sysdeps/unix/sysv/linux/arm/syscalls.list: Backout changes for versioning setrlimit and getrlimit. 2000-01-27 Andreas Jaeger <aj@suse.de> * sysdeps/powerpc/fpu/libm-ulps: Renamed to ... * sysdeps/powerpc/fpu/libm-test-ulps: ...this. 2000-01-27 Ruediger Oertel <ro@suse.de> * sysdeps/unix/sysv/linux/i386/sys/io.h: Change "::" to ": :" for g++. 2000-01-29 Ulrich Drepper <drepper@redhat.com>
Diffstat (limited to 'catgets/open_catalog.c')
-rw-r--r-- | catgets/open_catalog.c | 175 |
1 files changed, 93 insertions, 82 deletions
diff --git a/catgets/open_catalog.c b/catgets/open_catalog.c index aefa34f3fa..c5193e166d 100644 --- a/catgets/open_catalog.c +++ b/catgets/open_catalog.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper, <drepper@gnu.org>. @@ -84,89 +84,100 @@ __open_catalog (__nl_catd catalog) while (*run_nlspath != '\0') { bufact = 0; - while (*run_nlspath != ':' && *run_nlspath != '\0') - if (*run_nlspath == '%') - { - const char *tmp; - - ++run_nlspath; /* We have seen the `%'. */ - switch (*run_nlspath++) - { - case 'N': - /* Use the catalog name. */ - len = strlen (catalog->cat_name); - ENOUGH (len); - memcpy (&buf[bufact], catalog->cat_name, len); - bufact += len; - break; - case 'L': - /* Use the current locale category value. */ - len = strlen (catalog->env_var); - ENOUGH (len); - memcpy (&buf[bufact], catalog->env_var, len); - bufact += len; - break; - case 'l': - /* Use language element of locale category value. */ - tmp = catalog->env_var; - do - { - ENOUGH (1); - buf[bufact++] = *tmp++; - } - while (*tmp != '\0' && *tmp != '_' && *tmp != '.'); - break; - case 't': - /* Use territory element of locale category value. */ - tmp = catalog->env_var; - do - ++tmp; - while (*tmp != '\0' && *tmp != '_' && *tmp != '.'); - if (*tmp == '_') - { + + if (*run_nlspath == ':') + { + /* Leading colon or adjacent colons - treat same as %N. */ + len = strlen (catalog->cat_name); + ENOUGH (len); + memcpy (&buf[bufact], catalog->cat_name, len); + bufact += len; + } + else + while (*run_nlspath != ':' && *run_nlspath != '\0') + if (*run_nlspath == '%') + { + const char *tmp; + + ++run_nlspath; /* We have seen the `%'. */ + switch (*run_nlspath++) + { + case 'N': + /* Use the catalog name. */ + len = strlen (catalog->cat_name); + ENOUGH (len); + memcpy (&buf[bufact], catalog->cat_name, len); + bufact += len; + break; + case 'L': + /* Use the current locale category value. */ + len = strlen (catalog->env_var); + ENOUGH (len); + memcpy (&buf[bufact], catalog->env_var, len); + bufact += len; + break; + case 'l': + /* Use language element of locale category value. */ + tmp = catalog->env_var; + do + { + ENOUGH (1); + buf[bufact++] = *tmp++; + } + while (*tmp != '\0' && *tmp != '_' && *tmp != '.'); + break; + case 't': + /* Use territory element of locale category value. */ + tmp = catalog->env_var; + do ++tmp; - do - { - ENOUGH (1); - buf[bufact++] = *tmp; - } - while (*tmp != '\0' && *tmp != '.'); - } - break; - case 'c': - /* Use code set element of locale category value. */ - tmp = catalog->env_var; - do - ++tmp; - while (*tmp != '\0' && *tmp != '.'); - if (*tmp == '.') - { + while (*tmp != '\0' && *tmp != '_' && *tmp != '.'); + if (*tmp == '_') + { + ++tmp; + do + { + ENOUGH (1); + buf[bufact++] = *tmp++; + } + while (*tmp != '\0' && *tmp != '.'); + } + break; + case 'c': + /* Use code set element of locale category value. */ + tmp = catalog->env_var; + do ++tmp; - do - { - ENOUGH (1); - buf[bufact++] = *tmp; - } - while (*tmp != '\0'); - } - break; - case '%': - ENOUGH (1); - buf[bufact++] = '%'; - break; - default: - /* Unknown variable: ignore this path element. */ - bufact = 0; - while (*run_nlspath != '\0' && *run_nlspath != ':') - ++run_nlspath; - break; - } - } - else - { - ENOUGH (1); - buf[bufact++] = *run_nlspath++; - } + while (*tmp != '\0' && *tmp != '.'); + if (*tmp == '.') + { + ++tmp; + do + { + ENOUGH (1); + buf[bufact++] = *tmp++; + } + while (*tmp != '\0'); + } + break; + case '%': + ENOUGH (1); + buf[bufact++] = '%'; + break; + default: + /* Unknown variable: ignore this path element. */ + bufact = 0; + while (*run_nlspath != '\0' && *run_nlspath != ':') + ++run_nlspath; + break; + } + } + else + { + ENOUGH (1); + buf[bufact++] = *run_nlspath++; + } + ENOUGH (1); buf[bufact] = '\0'; |