From 900bec852d0bd53eb27b8b2193899f5cf470b38f Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 14 Jun 1997 23:17:05 +0000 Subject: Update. 1997-06-15 00:43 Ulrich Drepper * Makeconfig: Define libc-map here. * Makefile: And remove definition here. * Makerules (load-map-file): Handle case where map file is in other directory. (build-shlib): Likewise. * libc.map: Add more symbols. * resolv/libresolv.map: Likewise. * db/libdb.map: Add __dbopen. Patch by HJ Lu. * libio/stdio.h: Remove "optmizations" for vfscanf and vsscanf. * locale/programs/localedef.c: Add normalize_codeset function. We don't want to use the _nl_normalize_codeset functions from libc. * sysdeps/libm-i387/s_asinh.S: Handle +-Inf and NaN correctly. * sysdeps/libm-i387/s_asinhf.S: Likewise. * sysdeps/libm-i387/s_asinhl.S: Likewise. * sysdeps/libm-i387/s_nearbyint.S: Correctly leave function. * sysdeps/libm-i387/s_nearbyintf.S: Likewise. * sysdeps/libm-i387/s_nearbyintl.S: Likewise. 1997-06-14 12:45 Thorsten Kukuk * nis/nss_nis/nis-ethers.c: Add static to internal_nis_setetherent. * nis/nss_nis/nis-proto.c: Add static to internal_nis_setprotoent. * nis/nss_nisplus/nisplus-hosts.c: Rewrite parser and fix _nss_nisplus_gethostbyaddr_r interface. * nis/libnsl.map: Add all GLOBAL functions. 1997-06-13 18:32 Andreas Jaeger * libm-test.c (main): Call new tests, reorder tests. (fmod_test): Test function fmod. (nearbyint_test): Test function nearbyint. (acos_test): Add more test cases. (signbit_test): Test macro signbit. (output_result_bool): Output result if test fails. (asin_test): Add another test case. (atan2_test): Add more tests. (asinh_test): Add more tests. (atanh_test): Add more tests. (hypot_test): Add more tests. (isfinite_test): Test macro isfinite. (isnormal_test): Test macro isnormal. (sincos_test): Tests for sincos. (main): Enable remquo_test since the tests are correct (according to ANSI/IEEE 754-1985). (remquo_test): Corrected tests cases and added more tests. (remainder_test): Tests for remainder. (check_int): New Function to compare int values. (check_isnan_exc_ext): New function. (sqrt_test): Add some extra tests for sqrt. (erf_test): Tests for erf. (erfc_test): Tests for erfc. (gamma_test): Tests for gamma. (lgamma_test): Tests for lgamma. 1997-06-08 10:54 H.J. Lu * sysdeps/unix/sysv/linux/configure.in: Try to generate stdio_lim.h using the target C preprocessor and mk-stdiolim.c. * sysdeps/unix/sysv/linux/stdio_lim.h.in: New, template for stdio_lim.h. * sysdeps/unix/sysv/linux/mk-stdiolim.c: New, used by the target C preprocessor to extract OPEN_MAX and PATH_MAX. 1997-06-14 17:32 Andreas Jaeger * math/libm.map: Add inline functions, global variables. --- locale/programs/localedef.c | 48 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) (limited to 'locale/programs') diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c index 1830be3da4..34c7394d3d 100644 --- a/locale/programs/localedef.c +++ b/locale/programs/localedef.c @@ -36,7 +36,6 @@ #include "error.h" #include "charset.h" #include "locfile.h" -#include "../intl/loadinfo.h" /* Undefine the following line in the production version. */ /* #define NDEBUG 1 */ @@ -138,6 +137,7 @@ void *xmalloc (size_t __n); /* Prototypes for local functions. */ static void error_print (void); static const char *construct_output_path (char *path); +static const char *normalize_codeset (const char *codeset, size_t name_len); int @@ -475,7 +475,7 @@ construct_output_path (char *path) ++endp; if (endp > startp) - normal = _nl_normalize_codeset (startp, endp - startp); + normal = normalize_codeset (startp, endp - startp); } else /* This is to keep gcc quiet. */ @@ -512,3 +512,47 @@ construct_output_path (char *path) return result; } + +/* Normalize codeset name. There is no standard for the codeset + names. Normalization allows the user to use any of the common + names. */ +static const char * +normalize_codeset (codeset, name_len) + const char *codeset; + size_t name_len; +{ + int len = 0; + int only_digit = 1; + char *retval; + char *wp; + size_t cnt; + + for (cnt = 0; cnt < name_len; ++cnt) + if (isalnum (codeset[cnt])) + { + ++len; + + if (isalpha (codeset[cnt])) + only_digit = 0; + } + + retval = (char *) malloc ((only_digit ? 3 : 0) + len + 1); + + if (retval != NULL) + { + if (only_digit) + wp = stpcpy (retval, "iso"); + else + wp = retval; + + for (cnt = 0; cnt < name_len; ++cnt) + if (isalpha (codeset[cnt])) + *wp++ = tolower (codeset[cnt]); + else if (isdigit (codeset[cnt])) + *wp++ = codeset[cnt]; + + *wp = '\0'; + } + + return (const char *) retval; +} -- cgit v1.2.3