aboutsummaryrefslogtreecommitdiff
path: root/intl
AgeCommit message (Collapse)AuthorFilesLines
2014-02-10Use glibc_likely instead __builtin_expect.Ondřej Bílka4-23/+23
2014-01-01Update copyright notices with scripts/update-copyrightsAllan McRae42-42/+42
2013-06-08Use (void) in no-arguments function definitions.Joseph Myers3-3/+3
2013-05-22Fix _nl_find_msg malloc failure case, and callers.Carlos O'Donell2-5/+24
This patch fixes two issues, and perhaps should be two distinct commits, but I present it here as one for the sake of completeness. Commit 006dd86111c44572dbd3b26e9c63dd0f834d7762 fails to check malloc's return in intl/dcigettext.c (_nl_find_msg): ~~~ freemem_size = INITIAL_BLOCK_SIZE; newmem = (transmem_block_t *) malloc (freemem_size); ... newmem->next = transmem_list; transmem_list = newmem; ~~~ If malloc fails then newmem is NULL then newmem->next results in a fault. The fix is easy enough, check for newmem != NULL, and fall through to the error condition below which returns (char *) -1 e.g. resource error. The problem is that returning (char *) -1 will break all sorts of other code, so while what we did is correct, the real failure case fix is slightly broader. There are 4 other places where _nl_find_msg is called, one is OK, the other three are fixed to handle -1 error return value. No regressions on x86-64 or x86. However, no regressions isn't really a useful metric for this code. The change was tested as documented here: http://sourceware.org/glibc/wiki/Testing/WhiteBox using SystemTap for fault injection to simulate malloc failure. --- 2013-05-03 Carlos O'Donell <carlos at redhat.com> [BZ #15441] * intl/dcigettext.c (DCIGETTEXT): Skip translating if _nl_find_msg returns -1. (_nl_find_msg): Return -1 if recursive call returned -1. If newmem is null return -1. * intl/loadmsgcat.c (_nl_load_domain): If _nl_find_msg returns -1 abort loading the domain.
2013-02-15Remove bounded-pointers build system support.Joseph Myers1-3/+0
2013-01-11Add --enable-hardcoded-path-in-tests configure optionH.J. Lu6-15/+15
2013-01-02Update copyright notices with scripts/update-copyrights.Joseph Myers42-207/+185
2012-10-24Define and use $(run-built-tests).Joseph Myers1-1/+1
2012-10-19Use $(run-program-prefix) in more shell script tests.Joseph Myers4-11/+16
2012-09-25Set "fail on error" mode directly in testsuite shell scriptsDmitry V. Levin6-16/+21
2012-08-17Fix rule dependency in last change.Roland McGrath1-2/+2
2012-08-172012-08-17 Jeff Law <law@redhat.com>Jeff Law4-133/+19
* intl/Makefile (codeset_mo): New variable. ($(codeset_mo)): New target. (tst-codeset.out): Depend on that. Remove explicit rule. (tst-gettext3.out, tst-gettext5.out): Likewise. (LOCPATH-ENV, tst-codeset-ENV): New variables. (tst-gettext3-ENV, tst-gettext5-ENV): Likewise. * intl/tst-codeset.sh: Remove. * intl/tst-gettext3.sh: Likewise. * intl/tst-gettext5.sh: Likewise.
2012-07-30Fix lots of bitrot for stub configurations.Roland McGrath1-2/+5
2012-07-04Fix tst-gettext testAndreas Schwab3-53/+48
2012-06-21Update copyright yearsJeff Law1-1/+1
2012-06-21 [BZ #14277]Jeff Law1-6/+7
* intl/dcigettext.c (_nl_find_msg): Avoid use after potential free. Simplify list management for _LIBC case.
2012-05-24Remove use of INTDEF/INTUSE in intlAndreas Schwab4-16/+6
2012-03-10Replace FSF snail mail address with URL in Yacc input.Paul Eggert2-249/+295
2012-03-07Remove distribute variable from MakefilesUlrich Drepper1-10/+1
2012-02-09Replace FSF snail mail address with URLs.Paul Eggert43-127/+84
2012-01-07Remove pre-ISO C supportUlrich Drepper1-18/+18
No more __const.
2011-11-15Clean up internal fopen usesUlrich Drepper1-1/+1
No need to ever not use c and e.
2011-11-08Use strcasecmp_l instead of strcasecmpUlrich Drepper1-2/+2
2011-10-23More WSUlrich Drepper1-1/+1
2011-10-23Fix WSUlrich Drepper1-8/+7
2011-10-23Regnerate with modern bisonUlrich Drepper1-751/+1239
2011-09-10Cleanup of configuration optionsUlrich Drepper2-14/+2
Make several tool features mandatory and simplify the code.
2011-09-08Remove support for automatic cvs check-insUlrich Drepper1-4/+1
CVS use for glibc is long gone.
2011-08-13Fix compile problemUlrich Drepper1-8/+12
l10nflist compiles for localedef now. Optimize a bit.
2011-08-11Minor optimization of popcount in l10nflistUlrich Drepper1-0/+2
2011-08-11Locale-independent parsing in libintlUlrich Drepper1-6/+6
2011-07-20dcigettext.c: Add missing bracketMarek Polacek1-2/+2
2009-05-16Remove redundant .gitignore files.Andreas Schwab1-6/+0
2009-05-15rename each .cvsignore file to .gitignoreJim Meyering1-0/+0
2009-02-05* intl/dcigettext.c (DCIGETTEXT): Avoid some code duplication.Ulrich Drepper1-13/+2
2008-03-31[BZ #5443]Ulrich Drepper1-2/+14
2008-03-30 Ulrich Drepper <drepper@redhat.com> [BZ #5443] * intl/dcigettext.c (__dcigettext): Get reader lock for locale data before looking for translation. * locale/duplocale.c: Transform __libc_setlocale_lock into rwlock. * locale/freelocale.c: Likewise. * locale/newlocale.c: Likewise. * locale/setlocale.c: Likewise. Based partially on a patch by ryo@np.css.fujitsu.com.
2008-03-30* intl/dcigettext.c (_nl_find_msg): Reread nconversions afterUlrich Drepper4-14/+156
acquiring wrlock. Do conv_tab allocation while holding lock. * intl/Makefile: Add rules to build and run tst-gettext6. * intl/tst-gettext6.c: New test. * intl/tst-gettext6.sh: New file.
2008-03-19Remove useless "if" before "free".Ulrich Drepper2-8/+4
2007-11-17(struct known_translation_t): Turn msgid into a union. (transcmp): Use the ↵Ulrich Drepper1-15/+19
appropriate part of s1->msgid and s2->msgid. (DCIGETTEXT): Change the allocation of the 'search' variable so that it needs only fixed stack space. Delay the initialization of msgid_len until it is needed.
2007-10-28[BZ #5222]Ulrich Drepper1-5/+4
2007-10-28 Ulrich Drepper <drepper@redhat.com> [BZ #5222] * elf/dl-load.c (_dl_rtld_di_serinfo): Correct handling of short path elements in counting mode.
2007-10-13* intl/dcigettext.c (_nl_find_msg): Unlock the conversions_lockUlrich Drepper1-0/+1
when we cannot recode the message.
2007-09-24[BZ #5058]Ulrich Drepper2-5/+34
2007-09-24 Ulrich Drepper <drepper@redhat.com> [BZ #5058] * intl/gettextP.h (struct loaded_domain): Add conversions_lock member. * intl/loadmsgcat.c (_nl_load_domain): Initialize conversions_lock. (_nl_unload_domain): Finalize conversions_lock. * intl/dcigettext.c (_nl_find_msg): Take conversions_lock before handling table of known conversions. * posix/regcomp.c (lookup_collation_sequence_value): Check that
2007-09-24(struct loaded_domain): Add conversions_lock member.Ulrich Drepper1-0/+1
2007-08-03* intl/dcigettext.c (_nl_find_msg): Free encoding if __gconv_openUlrich Drepper2-2/+6
failed. * intl/finddomain.c (_nl_find_domain): Free normalized_codeset on failure. * elf/dl-load.c (decompose_rpath): Free copy if result couldn't be allocated. 2007-08-03 Jakub Jelinek <jakub@redhat.com>
2007-07-28* nss/nsswitch.c (__nss_lookup_function): Don't cast &ni->known toUlrich Drepper5-14/+14
void **. * nss/nsswitch.h (service_user): Use void * type for KNOWN field. * nss/nss_files/files-hosts.c (LINE_PARSER): Cast host_addr to char * to avoid warning. * nis/nss_nis/nis-hosts.c (LINE_PARSER): Likewise. * timezone/Makefile (CFLAGS-zdump.c): Add -fwrapv. * locale/programs/ld-ctype.c (ctype_finish, set_class_defaults, allocate_arrays): Cast second argument to charmap_find_symbol to char * to avoid warnings. * locale/programs/repertoire.c (repertoire_new_char): Change from_nr, to_nr and cnt to unsigned long, adjust printf format string. * locale/programs/ld-collate.c (insert_value, handle_ellipsis): Cast second argument to new_element to char * to avoid warnings. * locale/weightwc.h (findidx): Cast &extra[-i] to const int32_t *. * intl/gettextP.h (struct loaded_domain): Change plural to const struct expression *. * intl/plural-eval.c (plural_eval): Change first argument to const struct expression *. * intl/plural-exp.c (EXTRACT_PLURAL_EXPRESSION): Change first argument to const struct expression **. * intl/plural-exp.h (EXTRACT_PLURAL_EXPRESSION, plural_eval): Adjust prototypes. * intl/loadmsgcat (_nl_unload_domain): Cast away const in call to __gettext_free_exp. * posix/fnmatch.c (fnmatch): Rearrange code to avoid maybe unitialized wstring/wpattern var warnings. * posix/runtests.c (struct a_test): Make data field const char *. * stdio-common/tst-sprintf2.c (main): Don't declere u, v and buf vars if not LDBL_MANT_DIG >= 106. * stdio-common/Makefile (CFLAGS-vfwprintf.c): Add -Wno-unitialized. * stdio-common/vfprintf.c (vfprintf): Cast first arugment to __find_specmb to avoid warning. * rt/tst-mqueue1.c (do_one_test): Add casts to avoid warnings. * debug/test-strcpy_chk.c (do_tests, do_random_tests): Add casts to avoid warnings. * sysdeps/ieee754/ldbl-96/s_roundl.c (huge): Add L suffix to initializer. * sysdeps/unix/clock_gettime.c (clock_gettime): Only define tv var when it will be actually used. * sunrpc/rpc_cmsg.c (xdr_callmsg): Cast IXDR_PUT_* to void to avoid warnings.
2007-07-28* iconv/gconv_int.h (__GCONV_NULCONV): New internal only error code.Ulrich Drepper1-2/+2
* iconv/gconv_cache.c (__gconv_lookup_cache): Return __GCONV_NULCONV if from and to charsets are the same. * iconv/gconv_db.c (__gconv_find_transform): Likewise. * intl/dcigettext.c (_nl_find_msg): Return NULL even if __gconv_open returns __GCONV_NOCONV, but not for __GCONV_NULCONV. 2007-07-17 Jakub Jelinek <jakub@redhat.com> * wcsmbs/wchar.h: Only define wint_t if __need_wint_t. Don't define wint_t when __need_mbstate_t unless it is necessary. (__mbstate_t): Use __WINT_TYPE__ rather than wint_t in the typedef if possible. * wctype/wctype.h (wint_t): Define by including wchar.h with __need_wint_t instead of including stddef.h with __need_wint_t and as fallback definining it ourselves. * iconv/gconv.h (__need_wint_t): Define before including wchar.h. * sysdeps/gnu/_G_config.h: Don't include gconv.h if not _LIBC or _GLIBCPP_USE_WCHAR_T. (__need_wchar_t): Don't define if not _LIBC or _GLIBCPP_USE_WCHAR_T. (__need_wint_t): Don't define before including stddef.h, define before including wchar.h only if _LIBC or _GLIBCPP_USE_WCHAR_T. (_G_iconv_t): Don't define if not _LIBC or _GLIBCPP_USE_WCHAR_T. * sysdeps/mach/hurd/_G_config.h: Likewise. * sysdeps/generic/_G_config.h: Likewise. * libio/libio.h (__wunderflow, __wuflow, __woverflow): Only prototype if _LIBC or _GLIBCPP_USE_WCHAR_T. (_IO_getwc_unlocked, _IO_putwc_unlocked): Only define if _LIBC or _GLIBCPP_USE_WCHAR_T.
2007-07-12[BZ #4775, BZ #4776]Ulrich Drepper2-3/+8
2007-07-12 Jakub Jelinek <jakub@redhat.com> [BZ #4775] * math/tgmath.h (__tgmath_real_type_sub): Formatting. (__tgmath_real_type): Fix if expr is const int or other const qualified integral type. (__TGMATH_UNARY_REAL_ONLY): Rewritten to avoid using statement expressions and handle const qualified arguments. (__TGMATH_BINARY_FIRST_REAL_ONLY, __TGMATH_UNARY_REAL_IMAG, __TGMATH_UNARY_REAL_IMAG_RET_REAL): Likewise. (__TGMATH_UNARY_REAL_RET_ONLY): Rewritten to avoid using statement expressions. (__TGMATH_BINARY_REAL_ONLY, __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY, __TGMATH_TERNARY_REAL_ONLY, __TGMATH_BINARY_REAL_IMAG): Likewise. (__TGMATH_UNARY_IMAG): Define. (conj, cproj): Use __TGMATH_UNARY_IMAG macro. * math/Makefile (tests): Add test-tgmath2. (CFLAGS-test-tgmath2.c): Add. * math/test-tgmath.c (fy, dy, ly, fz, dz, lz, count_cdouble, count_cfloat, count_cldouble): New variables. (NCCALLS): Define. (main): Check number of complex calls as well. (F(compile_test)): Add complex tests and tests with const qualified arguments. (y, z, ccount): Define. (F(cacos), F(casin), F(catan), F(ccos), F(csin), F(ctan), F(cacosh), F(casinh), F(catanh), F(ccosh), F(csinh), F(ctanh), F(cexp), F(clog), F(csqrt), F(cpow), F(cabs), F(carg), F(creal), F(cimag), F(conj), F(cproj)): New functions. * math/test-tgmath2.c: New test. 2007-07-11 Jakub Jelinek <jakub@redhat.com> [BZ #4776] * elf/dl-load.c (_dl_rtld_di_serinfo): Output / in LD_LIBRARY_PATH, RPATH etc. as "/" rather than "", don't segfault on empty paths, instead output ".". * dlfcn/Makefile (distribute): Add glreflib3.c. (module-names): Add glreflib3. ($(objpfx)tst-dlinfo.out): Depend on glreflib3.so rather than glreflib1.so. (LDFLAGS_glreflib3.so): New. * dlfcn/tst-dlinfo.c (do_test): Load glreflib3.so instead of glreflib1.so. * dlfcn/glreflib3.c: New file. * intl/finddomain.c (_nl_find_domain): If _nl_explode_name returned -1, return NULL. * intl/explodename.c (_nl_explode_name): Return -1 if _nl_normalize_codeset failed.
2006-06-22* intl/dcigettext.c (DCIGETTEXT): If _nl_find_msg returns -1 don'tUlrich Drepper1-18/+36
look further, return original strings. (_nl_find_msg): Do not return found translation if the conversion failed. Either signal the string is unusable or that something went wrong and the original should be used. 2006-06-21 Ulrich Drepper <drepper@redhat.com> * string/_strerror.c (__strerror_r): Add __builtin_expect.
2006-05-15* locale/setlocale.c: Change _nl_category_names into a string.Ulrich Drepper1-2/+3
Add new _nl_category_name_idxs. Change all users. * locale/localeinfo.h: Adjust declaration of _nl_category_names. Declare _nl_category_name_idxs. * locale/findlocale.c: Adjust for _nl_category_names change. * locale/loadlocale.c: Likewise. * locale/newlocale.c: Likewise. * intl/dcigettext.c: Likewise.
2006-04-07* elf/ldconfig.c (main): Use rawmemchr instead of strchr.Ulrich Drepper1-2/+2
* nis/nis_call.c (rec_dirsearch): Likewise. * nis/nis_local_names.c (nis_local_host): Likewise. (nis_local_directory): Likewise. * intl/explodename.c (_nl_explode_name): Likewise. * sysdeps/generic/unwind-dw2.c (execute_cfa_program): Don't handle DW_CFA_GNU_windiw_save if it obviously cannot work [Coverity CID 102]. * locale/programs/ld-address.c (address_finish): Fix conditions for error messages [Coverity CID 104].