summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/source/texk/bibtex-x/ChangeLog16
-rw-r--r--Build/source/texk/bibtex-x/Makefile.am16
-rw-r--r--Build/source/texk/bibtex-x/Makefile.in15
-rw-r--r--Build/source/texk/bibtex-x/bibtex-4.c14
-rwxr-xr-xBuild/source/texk/bibtex-x/configure4
-rwxr-xr-xBuild/source/texk/bibtex-x/tests/bibtexu-basic.test25
-rwxr-xr-xBuild/source/texk/bibtex-x/tests/bibtexu-range.test22
-rwxr-xr-xBuild/source/texk/bibtex-x/tests/bibtexu-yannis.test21
-rw-r--r--Build/source/texk/bibtex-x/tests/ubasic.aux6
-rw-r--r--Build/source/texk/bibtex-x/tests/ubasic.bbl8
-rw-r--r--Build/source/texk/bibtex-x/tests/ubasic.bib13
-rw-r--r--Build/source/texk/bibtex-x/tests/ubasic.tex15
-rw-r--r--Build/source/texk/bibtex-x/tests/urange.aux6
-rw-r--r--Build/source/texk/bibtex-x/tests/urange.bbl8
-rw-r--r--Build/source/texk/bibtex-x/tests/urange.bib13
-rw-r--r--Build/source/texk/bibtex-x/tests/urange.tex15
-rw-r--r--Build/source/texk/bibtex-x/tests/yannis.bib2
17 files changed, 191 insertions, 28 deletions
diff --git a/Build/source/texk/bibtex-x/ChangeLog b/Build/source/texk/bibtex-x/ChangeLog
index de349ca24de..ce083bc9096 100644
--- a/Build/source/texk/bibtex-x/ChangeLog
+++ b/Build/source/texk/bibtex-x/ChangeLog
@@ -1,3 +1,19 @@
+2021-06-20 Karl Berry <karl@freefriends.org>
+
+ * Makefile.am (bibtexu_tests): add tests/bibtexu-{basic,range}.test.
+ (EXTRA_DIST, DISTCLEANFILES): likewise.
+ * tests/bibtexu-{basic,range}.test,
+ * tests/u{basic,range}.{aux,bbl,bib,tex}: new files from Dmitry.
+
+ * tests/bibtexu-yannis.test: reenable (probably failed due to lack
+ of pthread?), use same test template.
+ * tests/yannis.bib: credit Yannis.
+
+2021-06-20 Dmitry Zheleznyakov <dmitry.zhelezniakov@gmail.com>
+
+ * bibtex-4.c (x_substring, web section 438): adjust pop_lit1
+ before icu_fromUChars calls, to avoid crash on page ranges.
+
2021-06-19 Karl Berry <karl@freefriends.org>
* configure.ac [enable_bibtexu]: also check for -lpthread.
diff --git a/Build/source/texk/bibtex-x/Makefile.am b/Build/source/texk/bibtex-x/Makefile.am
index 0ed7887e9de..081783003c3 100644
--- a/Build/source/texk/bibtex-x/Makefile.am
+++ b/Build/source/texk/bibtex-x/Makefile.am
@@ -76,7 +76,8 @@ dist_btdoc_DATA = \
## Tests.
##
bibtex8_tests = tests/bibtex8.test tests/bibtex8-mem.test tests/sort.test
-bibtexu_tests = tests/bibtexu.test tests/bibtexu-yannis.test
+bibtexu_tests = tests/bibtexu.test tests/bibtexu-basic.test \
+ tests/bibtexu-range.test tests/bibtexu-yannis.test
TESTS =
if BIBTEX8
@@ -86,7 +87,8 @@ tests/bibtex8.log tests/bibtex8-mem.log tests/sort.log: bibtex8$(EXEEXT)
if BIBTEXU
TESTS += $(bibtexu_tests)
endif BIBTEXU
-tests/bibtexu.log tests/bibtexu-yannis.log: bibtexu$(EXEEXT)
+tests/bibtexu.log tests/bibtexu-basic.log tests/bibtexu-range.log \
+ tests/bibtexu-yannis.log: bibtexu$(EXEEXT)
EXTRA_DIST = $(bibtex8_tests) $(bibtexu_tests)
DISTCLEANFILES =
@@ -99,8 +101,18 @@ EXTRA_DIST += tests/sort.aux \
tests/sort1.csf tests/sort2.csf tests/sort3.csf \
tests/testdata.bib tests/teststyle.bst
DISTCLEANFILES += tests/xsort.aux tests/xsort.bbl tests/xsort.blg
+##
## tests/bibtex8-mem.test
DISTCLEANFILES += tests/memtest.bib tests/memtest?.*
+##
+## tests/bibtexu-basic.test
+EXTRA_DIST += tests/ubasic.aux tests/ubasic.bbl tests/ubasic.bib
+DISTCLEANFILES += tests/xubasic.aux tests/xubasic.bbl tests/xubasic.blg
+##
+## tests/bibtexu-range.test
+EXTRA_DIST += tests/urange.aux tests/urange.bbl tests/urange.bib
+DISTCLEANFILES += tests/xurange.aux tests/xurange.bbl tests/xurange.blg
+##
## tests/bibtexu-yannis.test
EXTRA_DIST += tests/yannis.aux tests/yannis.bbl tests/yannis.bib
DISTCLEANFILES += tests/xyannis.aux tests/xyannis.bbl tests/xyannis.blg
diff --git a/Build/source/texk/bibtex-x/Makefile.in b/Build/source/texk/bibtex-x/Makefile.in
index 54ecc0b23b4..801aa62aa2d 100644
--- a/Build/source/texk/bibtex-x/Makefile.in
+++ b/Build/source/texk/bibtex-x/Makefile.in
@@ -653,18 +653,24 @@ dist_btdoc_DATA = \
file_id.diz
bibtex8_tests = tests/bibtex8.test tests/bibtex8-mem.test tests/sort.test
-bibtexu_tests = tests/bibtexu.test tests/bibtexu-yannis.test
+bibtexu_tests = tests/bibtexu.test tests/bibtexu-basic.test \
+ tests/bibtexu-range.test tests/bibtexu-yannis.test
+
TESTS = $(am__append_3) $(am__append_4)
EXTRA_DIST = $(bibtex8_tests) $(bibtexu_tests) tests/sort.aux \
tests/sort1.bbl tests/sort2.bbl tests/sort3.bbl \
tests/sort1.csf tests/sort2.csf tests/sort3.csf \
- tests/testdata.bib tests/teststyle.bst tests/yannis.aux \
+ tests/testdata.bib tests/teststyle.bst tests/ubasic.aux \
+ tests/ubasic.bbl tests/ubasic.bib tests/urange.aux \
+ tests/urange.bbl tests/urange.bib tests/yannis.aux \
tests/yannis.bbl tests/yannis.bib bt371csf.zip dos-dj.mak \
dos-emx.mak os2.mak unix.mak csf/00readme.txt csf/COPYING \
csf/HISTORY csf/file_id.diz
DISTCLEANFILES = tests/xexampl.aux tests/xexampl.bbl tests/xexampl.blg \
tests/xsort.aux tests/xsort.bbl tests/xsort.blg \
- tests/memtest.bib tests/memtest?.* tests/xyannis.aux \
+ tests/memtest.bib tests/memtest?.* tests/xubasic.aux \
+ tests/xubasic.bbl tests/xubasic.blg tests/xurange.aux \
+ tests/xurange.bbl tests/xurange.blg tests/xyannis.aux \
tests/xyannis.bbl tests/xyannis.blg
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
@@ -1686,7 +1692,8 @@ $(bibtexu_OBJECTS): $(KPATHSEA_DEPEND) $(ICU_DEPEND)
@KPATHSEA_RULE@
@ICU_RULE@
tests/bibtex8.log tests/bibtex8-mem.log tests/sort.log: bibtex8$(EXEEXT)
-tests/bibtexu.log tests/bibtexu-yannis.log: bibtexu$(EXEEXT)
+tests/bibtexu.log tests/bibtexu-basic.log tests/bibtexu-range.log \
+ tests/bibtexu-yannis.log: bibtexu$(EXEEXT)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/Build/source/texk/bibtex-x/bibtex-4.c b/Build/source/texk/bibtex-x/bibtex-4.c
index 3a41e44911f..48cffb3cc21 100644
--- a/Build/source/texk/bibtex-x/bibtex-4.c
+++ b/Build/source/texk/bibtex-x/bibtex-4.c
@@ -2061,17 +2061,16 @@ back to UTF-8. 23/sep/2009
BEGIN
#ifdef UTF_8
unsigned char frUch1[BUF_SIZE+1];
- int32_t frUchCap = BUF_SIZE + 1;
- int32_t lenfrUch = icu_fromUChars(frUch1, frUchCap, &uchs[pop_lit2-1], pop_lit1);
unsigned char frUch2[BUF_SIZE+1];
- int32_t ptrfrUch = icu_fromUChars(frUch2, frUchCap, uchs, pop_lit2-1);
+ int32_t frUchCap = BUF_SIZE + 1;
+ int32_t lenfrUch;
+ int32_t ptrfrUch;
#endif
if (pop_lit1 > (sp_length - (pop_lit2 - 1)))
BEGIN
pop_lit1 = sp_length - (pop_lit2 - 1);
END
#ifdef UTF_8
- frUchCap = BUF_SIZE + 1;
lenfrUch = icu_fromUChars(frUch1, frUchCap, &uchs[pop_lit2-1], pop_lit1);
ptrfrUch = icu_fromUChars(frUch2, frUchCap, uchs, pop_lit2-1);
sp_ptr = str_start[pop_lit3] + ptrfrUch;
@@ -2095,10 +2094,10 @@ back to UTF-8. 23/sep/2009
BEGIN
#ifdef UTF_8
unsigned char frUch1[BUF_SIZE+1];
- int32_t frUchCap = BUF_SIZE + 1;
- int32_t lenfrUch = icu_fromUChars(frUch1, frUchCap, &uchs[ulen - (pop_lit2-1) - pop_lit1], pop_lit1);
unsigned char frUch2[BUF_SIZE+1];
- int32_t ptrfrUch = icu_fromUChars(frUch2, frUchCap, &uchs[ulen - pop_lit2], pop_lit2-1);
+ int32_t frUchCap = BUF_SIZE + 1;
+ int32_t lenfrUch;
+ int32_t ptrfrUch;
#endif
pop_lit2 = -pop_lit2;
if (pop_lit1 > (Integer_T) (sp_length - (pop_lit2 - 1)))
@@ -2106,7 +2105,6 @@ back to UTF-8. 23/sep/2009
pop_lit1 = sp_length - (pop_lit2 - 1);
END
#ifdef UTF_8
- frUchCap = BUF_SIZE + 1;
lenfrUch = icu_fromUChars(frUch1, frUchCap, &uchs[ulen - (pop_lit2-1) - pop_lit1], pop_lit1);
ptrfrUch = icu_fromUChars(frUch2, frUchCap, &uchs[ulen - pop_lit2], pop_lit2-1);
sp_ptr = str_start[pop_lit3] + ptrfrUch;
diff --git a/Build/source/texk/bibtex-x/configure b/Build/source/texk/bibtex-x/configure
index d50f9e3a036..fdf8abcfe3b 100755
--- a/Build/source/texk/bibtex-x/configure
+++ b/Build/source/texk/bibtex-x/configure
@@ -17648,9 +17648,7 @@ fi
if test "x$enable_bibtexu" != xno; then
- # As of ICU 65.1, ICU requires -lpthread on x86_64-linux and, most
- # likely, on other platforms. See upmendex/configure.ac for more info.
-kpse_save_CPPFLAGS=$CPPFLAGS
+ kpse_save_CPPFLAGS=$CPPFLAGS
kpse_save_LIBS=$LIBS
##tldbg _KPSE_INIT: Initialize TL infrastructure.
diff --git a/Build/source/texk/bibtex-x/tests/bibtexu-basic.test b/Build/source/texk/bibtex-x/tests/bibtexu-basic.test
new file mode 100755
index 00000000000..0db8e5f2953
--- /dev/null
+++ b/Build/source/texk/bibtex-x/tests/bibtexu-basic.test
@@ -0,0 +1,25 @@
+#! /bin/sh -vx
+# $Id: bibtexu-yannis.test 51452 2019-06-25 01:28:47Z karl $
+# Public domain. Originally written by Karl Berry, 2021.
+
+test -d tests || mkdir -p tests
+
+testname=ubasic
+# due to lack of libpthread:
+# terminate called after throwing an instance of 'std::system_error'
+# what(): Unknown error -1
+# Aborted
+
+cp $srcdir/tests/$testname.aux tests/x$testname.aux || exit 1
+
+TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF
+BSTINPUTS=$srcdir/../tests/texmf; export BSTINPUTS
+BIBINPUTS=$srcdir/tests; export BIBINPUTS
+
+if ./bibtexu -t -d all tests/x$testname; then :; else
+ echo "*** bibtexu failed, tests/x$testname.blg is:" >&2
+ cat tests/x$testname.blg >&2
+ exit 1
+fi
+
+diff $srcdir/tests/$testname.bbl tests/x$testname.bbl || exit 1
diff --git a/Build/source/texk/bibtex-x/tests/bibtexu-range.test b/Build/source/texk/bibtex-x/tests/bibtexu-range.test
new file mode 100755
index 00000000000..7eefbca6f3e
--- /dev/null
+++ b/Build/source/texk/bibtex-x/tests/bibtexu-range.test
@@ -0,0 +1,22 @@
+#! /bin/sh -vx
+# $Id$
+# Public domain. Originally written by Karl Berry, 2021.
+
+test -d tests || mkdir -p tests
+
+testname=urange
+# Segmentation fault
+
+cp $srcdir/tests/$testname.aux tests/x$testname.aux
+
+TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF
+BSTINPUTS=$srcdir/../tests/texmf; export BSTINPUTS
+BIBINPUTS=$srcdir/tests; export BIBINPUTS
+
+if ./bibtexu -t -d all tests/x$testname; then :; else
+ echo "*** bibtexu failed, tests/x$testname.blg is:" >&2
+ cat tests/x$testname.blg >&2
+ exit 1
+fi
+
+diff $srcdir/tests/$testname.bbl tests/x$testname.bbl || exit 1
diff --git a/Build/source/texk/bibtex-x/tests/bibtexu-yannis.test b/Build/source/texk/bibtex-x/tests/bibtexu-yannis.test
index 548d30f32cb..8d5a6dd63de 100755
--- a/Build/source/texk/bibtex-x/tests/bibtexu-yannis.test
+++ b/Build/source/texk/bibtex-x/tests/bibtexu-yannis.test
@@ -1,24 +1,23 @@
#! /bin/sh -vx
# $Id$
-# Copyright 2019 Karl Berry <tex-live@tug.org>
+# Copyright 2019-2021 Karl Berry <tex-live@tug.org>
# You may freely use, modify and/or distribute this file.
-
-# Test file prepared by Yannis Haralambous in 2009.
-
-exit 0 # temp until fixed
+# Some actual sorting needed.
test -d tests || mkdir -p tests
-cp $srcdir/tests/yannis.aux tests/xyannis.aux
+testname=yannis
+
+cp $srcdir/tests/$testname.aux tests/x$testname.aux || exit 1
TEXMFCNF=$srcdir/../kpathsea; export TEXMFCNF
BSTINPUTS=$srcdir/../web2c/tests; export BSTINPUTS
BIBINPUTS=$srcdir/tests; export BIBINPUTS
-if ./bibtexu -l fr -o fr -t -d all tests/xyannis; then :; else
- echo "bibtexu failed, tests/xyannis.blg is:" >&2
- cat tests/xyannis.blg >&2
+
+if ./bibtexu -t -d all -l fr -o fr tests/x$testname; then :; else
+ echo "*** bibtexu failed, tests/x$testname.blg is:" >&2
+ cat tests/x$testname.blg >&2
exit 1
fi
-diff $srcdir/tests/yannis.bbl tests/xyannis.bbl || exit 1
-
+diff $srcdir/tests/$testname.bbl tests/x$testname.bbl || exit 1
diff --git a/Build/source/texk/bibtex-x/tests/ubasic.aux b/Build/source/texk/bibtex-x/tests/ubasic.aux
new file mode 100644
index 00000000000..4795668d63e
--- /dev/null
+++ b/Build/source/texk/bibtex-x/tests/ubasic.aux
@@ -0,0 +1,6 @@
+\relax
+\citation{li2018fuzzing}
+\bibstyle{plain}
+\bibdata{ubasic}
+\@writefile{toc}{\contentsline {section}{\numberline {1}Test}{1}{}\protected@file@percent }
+\gdef \@abspage@last{1}
diff --git a/Build/source/texk/bibtex-x/tests/ubasic.bbl b/Build/source/texk/bibtex-x/tests/ubasic.bbl
new file mode 100644
index 00000000000..340e2dd0534
--- /dev/null
+++ b/Build/source/texk/bibtex-x/tests/ubasic.bbl
@@ -0,0 +1,8 @@
+\begin{thebibliography}{1}
+
+\bibitem{li2018fuzzing}
+Jun Li, Bodong Zhao, and Chao Zhang.
+\newblock Fuzzing: a survey.
+\newblock {\em Cybersecurity}, 1(1):6, 2018.
+
+\end{thebibliography}
diff --git a/Build/source/texk/bibtex-x/tests/ubasic.bib b/Build/source/texk/bibtex-x/tests/ubasic.bib
new file mode 100644
index 00000000000..4fa47107429
--- /dev/null
+++ b/Build/source/texk/bibtex-x/tests/ubasic.bib
@@ -0,0 +1,13 @@
+% $Id$
+% Public domain. Submitted by Dmitry Zheleznyakov, 2021.
+
+@article{li2018fuzzing,
+ title={Fuzzing: a survey},
+ author={Li, Jun and Zhao, Bodong and Zhang, Chao},
+ journal={Cybersecurity},
+ volume={1},
+ number={1},
+ pages={6},
+ year={2018},
+ publisher={Springer}
+}
diff --git a/Build/source/texk/bibtex-x/tests/ubasic.tex b/Build/source/texk/bibtex-x/tests/ubasic.tex
new file mode 100644
index 00000000000..7832e1435ee
--- /dev/null
+++ b/Build/source/texk/bibtex-x/tests/ubasic.tex
@@ -0,0 +1,15 @@
+% $Id$
+% Public domain. Submitted by Dmitry Zheleznyakov, 2021.
+
+\documentclass{article}
+\usepackage[utf8]{inputenc}
+
+\begin{document}
+
+\section{Test}
+Test~\cite{li2018fuzzing}.
+
+\bibliographystyle{plain}
+\bibliography{ubasic}
+
+\end{document}
diff --git a/Build/source/texk/bibtex-x/tests/urange.aux b/Build/source/texk/bibtex-x/tests/urange.aux
new file mode 100644
index 00000000000..30a3a58ebad
--- /dev/null
+++ b/Build/source/texk/bibtex-x/tests/urange.aux
@@ -0,0 +1,6 @@
+\relax
+\citation{li2018range}
+\bibstyle{plain}
+\bibdata{urange}
+\@writefile{toc}{\contentsline {section}{\numberline {1}Test}{1}{}\protected@file@percent }
+\gdef \@abspage@last{1}
diff --git a/Build/source/texk/bibtex-x/tests/urange.bbl b/Build/source/texk/bibtex-x/tests/urange.bbl
new file mode 100644
index 00000000000..8a37988ef2b
--- /dev/null
+++ b/Build/source/texk/bibtex-x/tests/urange.bbl
@@ -0,0 +1,8 @@
+\begin{thebibliography}{1}
+
+\bibitem{li2018range}
+Jun Li, Bodong Zhao, and Chao Zhang.
+\newblock Fuzzing: a survey.
+\newblock {\em Cybersecurity}, 1(1):3--6, 2018.
+
+\end{thebibliography}
diff --git a/Build/source/texk/bibtex-x/tests/urange.bib b/Build/source/texk/bibtex-x/tests/urange.bib
new file mode 100644
index 00000000000..61b5c5ab529
--- /dev/null
+++ b/Build/source/texk/bibtex-x/tests/urange.bib
@@ -0,0 +1,13 @@
+% $Id$
+% Public domain. Submitted by Dmitry Zheleznyakov, 2021.
+
+@article{li2018range,
+ title={Fuzzing: a survey},
+ author={Li, Jun and Zhao, Bodong and Zhang, Chao},
+ journal={Cybersecurity},
+ volume={1},
+ number={1},
+ pages={3--6},
+ year={2018},
+ publisher={Springer}
+}
diff --git a/Build/source/texk/bibtex-x/tests/urange.tex b/Build/source/texk/bibtex-x/tests/urange.tex
new file mode 100644
index 00000000000..59ea1e086e3
--- /dev/null
+++ b/Build/source/texk/bibtex-x/tests/urange.tex
@@ -0,0 +1,15 @@
+% $Id$
+% Public domain. Submitted by Dmitry Zheleznyakov, 2021.
+
+\documentclass{article}
+\usepackage[utf8]{inputenc}
+
+\begin{document}
+
+\section{Test}
+Test~\cite{li2018range}.
+
+\bibliographystyle{plain}
+\bibliography{urange}
+
+\end{document}
diff --git a/Build/source/texk/bibtex-x/tests/yannis.bib b/Build/source/texk/bibtex-x/tests/yannis.bib
index b442eeb88a2..7ed72dd569e 100644
--- a/Build/source/texk/bibtex-x/tests/yannis.bib
+++ b/Build/source/texk/bibtex-x/tests/yannis.bib
@@ -1,3 +1,5 @@
+% $Id$
+% Public domain. Submitted by Yannis Haralambous, 2009.
@book{cle1,
Author = {Διογένης},