texlive[50253] Build/source/texk/bibtex-x: Check error status for

commits+kakuto at tug.org commits+kakuto at tug.org
Wed Mar 6 10:08:52 CET 2019


Revision: 50253
          http://tug.org/svn/texlive?view=revision&revision=50253
Author:   kakuto
Date:     2019-03-06 10:08:51 +0100 (Wed, 06 Mar 2019)
Log Message:
-----------
Check error status for every call of u_strFromUTF8WithSub() (H. Yamashita)

Modified Paths:
--------------
    trunk/Build/source/texk/bibtex-x/ChangeLog
    trunk/Build/source/texk/bibtex-x/bibtex-2.c

Modified: trunk/Build/source/texk/bibtex-x/ChangeLog
===================================================================
--- trunk/Build/source/texk/bibtex-x/ChangeLog	2019-03-06 05:14:24 UTC (rev 50252)
+++ trunk/Build/source/texk/bibtex-x/ChangeLog	2019-03-06 09:08:51 UTC (rev 50253)
@@ -1,3 +1,8 @@
+2019-03-06  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
+
+	* bibtex-2.c: Check error status for every call of
+	u_strFromUTF8WithSub().
+
 2019-03-05  Akira Kakuto  <kakuto at w32tex.org>
 
 	* bibtex-2.c: Use u_strFromUTF8WithSub() with a substitution

Modified: trunk/Build/source/texk/bibtex-x/bibtex-2.c
===================================================================
--- trunk/Build/source/texk/bibtex-x/bibtex-2.c	2019-03-06 05:14:24 UTC (rev 50252)
+++ trunk/Build/source/texk/bibtex-x/bibtex-2.c	2019-03-06 09:08:51 UTC (rev 50253)
@@ -2966,6 +2966,7 @@
 /*
 Use u_strFromUTF8WithSub() with a substitution character 0xfffd,
 instead of u_strFromUTF8(). (05/mar/2019)
+If err1 != U_ZERO_ERROR, the original functions are used. (06/mar/2019)
 */
 
 /*
@@ -2973,14 +2974,15 @@
   uchlen2 = icu_toUChars(entry_strs, (ptr2 * (ENT_STR_SIZE+1)), lenk2, uch2, ucap);
 */
   u_strFromUTF8WithSub(uch1, ucap, &uchlen1, (char *)&ENTRY_STRS(ptr1, 0), lenk1, 0xfffd, NULL, &err1);
+
+  if (!U_SUCCESS(err1)) {
+    uchlen1 = icu_toUChars(entry_strs, (ptr1 * (ENT_STR_SIZE+1)), lenk1, uch1, ucap);
+    err1 = U_ZERO_ERROR;
+  }
+
   u_strFromUTF8WithSub(uch2, ucap, &uchlen2, (char *)&ENTRY_STRS(ptr2, 0), lenk2, 0xfffd, NULL, &err1);
 
-/*
-  If err1 != U_ZERO_ERROR, we use the original functions.
-*/
-
   if (!U_SUCCESS(err1)) {
-    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);
     err1 = U_ZERO_ERROR;
   }



More information about the tex-live-commits mailing list