summaryrefslogtreecommitdiff
path: root/Build/source/texk/bibtex-x/bibtex-2.c
diff options
context:
space:
mode:
authorHironobu Yamashita <h.y.acetaminophen@gmail.com>2019-03-04 11:43:10 +0000
committerHironobu Yamashita <h.y.acetaminophen@gmail.com>2019-03-04 11:43:10 +0000
commit4e8cee9aea1413316ee0fd94404f8b9d8d10cd78 (patch)
tree3e67be7a808de63804a176015a42a9aaf4c23500 /Build/source/texk/bibtex-x/bibtex-2.c
parent44a9f4188160b309de307a135225022554b1f419 (diff)
bibtexu: add trace for sorting
git-svn-id: svn://tug.org/texlive/trunk@50224 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/bibtex-x/bibtex-2.c')
-rw-r--r--Build/source/texk/bibtex-x/bibtex-2.c20
1 files changed, 20 insertions, 0 deletions
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