diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2019-03-05 01:00:09 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2019-03-05 01:00:09 +0000 |
commit | b892a546391950a0570da9d680fe4edc5b0bbec9 (patch) | |
tree | a029de5bf59a01c1352ba063ef8ba1fb1746d7ca | |
parent | ad489b16912445bb7b319c19adf6484c572f8d8c (diff) |
avoid access violation
git-svn-id: svn://tug.org/texlive/trunk@50231 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/texk/bibtex-x/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/bibtex-x/bibtex-2.c | 15 |
2 files changed, 19 insertions, 0 deletions
diff --git a/Build/source/texk/bibtex-x/ChangeLog b/Build/source/texk/bibtex-x/ChangeLog index f612518c0cb..7a52cff69e7 100644 --- a/Build/source/texk/bibtex-x/ChangeLog +++ b/Build/source/texk/bibtex-x/ChangeLog @@ -1,3 +1,7 @@ +2019-03-05 Akira Kakuto <kakuto@w32tex.org> + + * bibtex-2.c: Avoid access violation on Windows. + 2019-03-04 Hironobu Yamashita <h.y.acetaminophen@gmail.com> Both BibTeX8 and BibTeXu: diff --git a/Build/source/texk/bibtex-x/bibtex-2.c b/Build/source/texk/bibtex-x/bibtex-2.c index 7dcb75161df..9d6203affe1 100644 --- a/Build/source/texk/bibtex-x/bibtex-2.c +++ b/Build/source/texk/bibtex-x/bibtex-2.c @@ -2969,6 +2969,21 @@ icu_toUChars() seems not working here, using u_strFromUTF8 instead. (04/mar/2019 u_strFromUTF8(uch1, ucap, &uchlen1, (char *)&ENTRY_STRS(ptr1, 0), lenk1, &err1); u_strFromUTF8(uch2, ucap, &uchlen2, (char *)&ENTRY_STRS(ptr2, 0), lenk2, &err1); +/* + In my Windows build, the above fails: err1 != U_ZERO_ERROR, which + gives access violation in ucol_open(). Maybe my ICU build is wrong. + In this case I use the original functions which seem not working, + only to avoid a crash by access violation. Thus I cannot support + correct behavior for bibtexu on Windows. -- A. Kakuto 2019/03/05 +*/ + + 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; + if(Flag_location) ucol1 = ucol_open(Str_location, &err1); else |