diff options
author | Hironobu Yamashita <h.y.acetaminophen@gmail.com> | 2019-03-04 11:43:10 +0000 |
---|---|---|
committer | Hironobu Yamashita <h.y.acetaminophen@gmail.com> | 2019-03-04 11:43:10 +0000 |
commit | 4e8cee9aea1413316ee0fd94404f8b9d8d10cd78 (patch) | |
tree | 3e67be7a808de63804a176015a42a9aaf4c23500 /Build | |
parent | 44a9f4188160b309de307a135225022554b1f419 (diff) |
bibtexu: add trace for sorting
git-svn-id: svn://tug.org/texlive/trunk@50224 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/bibtex-x/ChangeLog | 11 | ||||
-rw-r--r-- | Build/source/texk/bibtex-x/bibtex-2.c | 20 |
2 files changed, 29 insertions, 2 deletions
diff --git a/Build/source/texk/bibtex-x/ChangeLog b/Build/source/texk/bibtex-x/ChangeLog index b040f64ff3b..db31feb0e79 100644 --- a/Build/source/texk/bibtex-x/ChangeLog +++ b/Build/source/texk/bibtex-x/ChangeLog @@ -1,10 +1,17 @@ 2019-03-04 Hironobu Yamashita <h.y.acetaminophen@gmail.com> + Both BibTeX8 and BibTeXu: + * bibtex-2.c: Add trace for sorting. (There is no related + code in the original BibTeX, but can be useful.) + Suppress compiler warnings. * bibtex.c, utils.c: Print ICU version in BibTeXu. + + BibTeXu only: + * bibtex-2.c: Use u_strFromUTF8() instead of icu_toUChars() + while sorting for BibTeXu. Close UConverter properly. + * bibtex-4.c: Fix x_purify() for BibTeXu. * utils.c: Default to Flag_8bit in BibTeXu. We should NOT read any csf file in BibTeXu. (BibTeX8 is unaffected) - * bibtex-4.c: Fix x_purify() for BibTeXu. - * bibtex-2.c: Suppress compiler warnings. 2017-04-27 Karl Berry <karl@tug.org> diff --git a/Build/source/texk/bibtex-x/bibtex-2.c b/Build/source/texk/bibtex-x/bibtex-2.c index c0a97abd5fc..7dcb75161df 100644 --- a/Build/source/texk/bibtex-x/bibtex-2.c +++ b/Build/source/texk/bibtex-x/bibtex-2.c @@ -2949,14 +2949,25 @@ we use "-o" to indicate the rule of conpare. 23/sep/2009 char2; #endif +#ifdef TRACE + if (Flag_trace) + TRACE_PR_LN3 ("Comparing entry %ld and %ld ...", arg1, arg2); +#endif /* TRACE */ ptr1 = (arg1 * num_ent_strs) + sort_key_num; ptr2 = (arg2 * num_ent_strs) + sort_key_num; #ifdef UTF_8 lenk1 = strlen((char *)&ENTRY_STRS(ptr1, 0)); lenk2 = strlen((char *)&ENTRY_STRS(ptr2, 0)); +/* +icu_toUChars() seems not working here, using u_strFromUTF8 instead. (04/mar/2019) +*/ +/* uchlen1 = icu_toUChars(entry_strs, (ptr1 * (ENT_STR_SIZE+1)), lenk1, uch1, ucap); uchlen2 = icu_toUChars(entry_strs, (ptr2 * (ENT_STR_SIZE+1)), lenk2, uch2, ucap); +*/ + u_strFromUTF8(uch1, ucap, &uchlen1, (char *)&ENTRY_STRS(ptr1, 0), lenk1, &err1); + u_strFromUTF8(uch2, ucap, &uchlen2, (char *)&ENTRY_STRS(ptr2, 0), lenk2, &err1); if(Flag_location) ucol1 = ucol_open(Str_location, &err1); @@ -2965,6 +2976,10 @@ we use "-o" to indicate the rule of conpare. 23/sep/2009 if (!U_SUCCESS(err1)) printf("there is a error: U_ZERO_ERROR, open a ucol."); u_less = !ucol_greaterOrEqual(ucol1, uch1, uchlen1, uch2, uchlen2); +#ifdef TRACE + if (Flag_trace) + TRACE_PR_LN2 ("... first is smaller than second? -- %s (ICU)", (u_less?"T":"F")); +#endif /* TRACE */ ucol_close(ucol1); return u_less; @@ -3011,6 +3026,10 @@ we use "-o" to indicate the rule of conpare. 23/sep/2009 INCR (char_ptr); END Exit_Label: +#ifdef TRACE + if (Flag_trace) + TRACE_PR_LN2 ("... first is smaller than second? -- %s", (less_than?"T":"F")); +#endif /* TRACE */ return (less_than); #endif END @@ -3126,6 +3145,7 @@ BEGIN BEGIN printf("2there is a error: U_ZERO_ERROR"); END + ucnv_close(ucon1); return len; END |