summaryrefslogtreecommitdiff
path: root/Build/source/texk/bibtex8
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2010-03-18 08:58:40 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2010-03-18 08:58:40 +0000
commit167298e9e82e1dd43b0a8e97d30ba5c58e8e98ea (patch)
tree6fa7a472f69fcd147d5c873b3bb237b33a10eeda /Build/source/texk/bibtex8
parent30dd886c5532920b4670260266bf16c1db123f7c (diff)
more bibtex/bibtex8/bibtexu updates and tests
git-svn-id: svn://tug.org/texlive/trunk@17492 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/bibtex8')
-rw-r--r--Build/source/texk/bibtex8/ChangeLog7
-rw-r--r--Build/source/texk/bibtex8/Makefile.am10
-rw-r--r--Build/source/texk/bibtex8/Makefile.in6
-rw-r--r--Build/source/texk/bibtex8/bibtex-1.c9
-rwxr-xr-xBuild/source/texk/bibtex8/tests/bibtex-mem.test64
-rwxr-xr-xBuild/source/texk/bibtex8/tests/sort.test2
6 files changed, 87 insertions, 11 deletions
diff --git a/Build/source/texk/bibtex8/ChangeLog b/Build/source/texk/bibtex8/ChangeLog
index 3dd0081f05a..8f68a88ca3d 100644
--- a/Build/source/texk/bibtex8/ChangeLog
+++ b/Build/source/texk/bibtex8/ChangeLog
@@ -6,6 +6,13 @@
* gblvars.h (M_cites): Removed.
* utils.c (parse_cmd_line, usage): Ignore/remove --mcites.
+ * bibtex-1.c (add_database_cite): Fix bug, from bibtex.ch.
+
+ * Makefile.am (AM_CPPFLAGS): Remove obsolete -funsigned-char.
+
+ * tests/bibtex-mem.test: New shell script for dynamic arrays.
+ * Makefile.am: Adapted.
+
2010-03-16 Peter Breitenlohner <peb@mppmu.mpg.de>
* bibtex-1.c, utils.c: Delay allocation of entry_ints and
diff --git a/Build/source/texk/bibtex8/Makefile.am b/Build/source/texk/bibtex8/Makefile.am
index fded8d43632..5a02c0d3ba7 100644
--- a/Build/source/texk/bibtex8/Makefile.am
+++ b/Build/source/texk/bibtex8/Makefile.am
@@ -9,12 +9,6 @@ INCLUDES = $(KPATHSEA_INCLUDES)
AM_CPPFLAGS = -DUNIX -DKPATHSEA -DSUPPORT_8BIT
AM_CFLAGS = $(WARNING_CFLAGS)
-## FIXME: (1) this should go away once the code has been carefully
-## FIXME: analyzed and uses 'unsigned char' where necessary.
-## FIXME: (2) this should go to AM_CFLAGS, but AIX xlc only
-## FIXME: accepts this flag when compiling, not when linking.
-AM_CPPFLAGS += -funsigned-char
-
bin_PROGRAMS = bibtex8
bibtex8_SOURCES = \
@@ -61,7 +55,7 @@ dist_btdoc_DATA = \
## Tests.
##
-TESTS = tests/bibtex.test tests/sort.test
+TESTS = tests/bibtex.test tests/sort.test tests/bibtex-mem.test
EXTRA_DIST = $(TESTS)
DISTCLEANFILES =
## tests/bibtex.test
@@ -72,6 +66,8 @@ 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/bibtex-mem.test
+DISTCLEANFILES += tests/memtest*
## Not used
##
diff --git a/Build/source/texk/bibtex8/Makefile.in b/Build/source/texk/bibtex8/Makefile.in
index c79f929da25..dc64b5c6da4 100644
--- a/Build/source/texk/bibtex8/Makefile.in
+++ b/Build/source/texk/bibtex8/Makefile.in
@@ -250,7 +250,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
ACLOCAL_AMFLAGS = -I ../../m4
INCLUDES = $(KPATHSEA_INCLUDES)
-AM_CPPFLAGS = -DUNIX -DKPATHSEA -DSUPPORT_8BIT -funsigned-char
+AM_CPPFLAGS = -DUNIX -DKPATHSEA -DSUPPORT_8BIT
AM_CFLAGS = $(WARNING_CFLAGS)
bibtex8_SOURCES = \
bibtex-1.c \
@@ -286,14 +286,14 @@ dist_btdoc_DATA = \
csfile.txt \
file_id.diz
-TESTS = tests/bibtex.test tests/sort.test
+TESTS = tests/bibtex.test tests/sort.test tests/bibtex-mem.test
EXTRA_DIST = $(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 \
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/xsort.aux tests/xsort.bbl tests/xsort.blg tests/memtest*
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
diff --git a/Build/source/texk/bibtex8/bibtex-1.c b/Build/source/texk/bibtex8/bibtex-1.c
index f2a1b8e6680..a288a313527 100644
--- a/Build/source/texk/bibtex8/bibtex-1.c
+++ b/Build/source/texk/bibtex8/bibtex-1.c
@@ -231,7 +231,7 @@ END
void add_database_cite (CiteNumber_T *new_cite)
BEGIN
check_cite_overflow (*new_cite);
- check_field_overflow (num_fields * (*new_cite));
+ check_field_overflow (num_fields * (*new_cite + 1));
cite_list[*new_cite] = hash_text[cite_loc];
ilk_info[cite_loc] = *new_cite;
ilk_info[lc_cite_loc] = cite_loc;
@@ -2806,8 +2806,15 @@ void check_field_overflow (Integer_T total_fields)
BEGIN
if (total_fields > Max_Fields)
BEGIN
+ field_ptr = Max_Fields;
BIB_XRETALLOC ("field_info", field_info, StrNumber_T,
Max_Fields, Max_Fields + MAX_FIELDS);
+ /* Initialize to |missing|. */
+ while (field_ptr < Max_Fields)
+ BEGIN
+ field_info[field_ptr] = MISSING;
+ INCR (field_ptr);
+ END
END
END
/*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 226 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
diff --git a/Build/source/texk/bibtex8/tests/bibtex-mem.test b/Build/source/texk/bibtex8/tests/bibtex-mem.test
new file mode 100755
index 00000000000..4a6bea5c0b6
--- /dev/null
+++ b/Build/source/texk/bibtex8/tests/bibtex-mem.test
@@ -0,0 +1,64 @@
+#! /bin/sh
+
+# Copyright (C) 2010 Peter Breitenlohner <tex-live@tug.org>
+# You may freely use, modify and/or distribute this file.
+
+# Using test data from Philipp Lehman <lehman@gmx.net>
+
+test -d tests || mkdir -p tests
+
+# Create bib data
+mk_bib () {
+ for i
+ do
+ for j in 0 1 2 3 4 5 6 7 8 9; do
+ for k in 0 1 2 3 4 5 6 7 8 9; do
+ for l in 0 1 2 3 4 5 6 7 8 9; do
+ cat <<EOF
+@Type{key$i$j$k$l,
+ field001 = {Value 001},
+ field002 = {Value 002},
+ field003 = {Value 003},
+ field004 = {Value 004},
+ field005 = {Value 005},
+ field006 = {Value 006},
+ field007 = {Value 007},
+ field008 = {Value 008},
+ field009 = {Value 009},
+ field010 = {Value 010}
+}
+
+EOF
+ done
+ done
+ done
+ done
+}
+
+# Create aux data
+mk_aux () {
+ echo '\relax'
+ echo '\citation{*}'
+ echo '\bibstyle{'$1'}'
+ echo '\bibdata{memtest}'
+}
+
+for t in 1 2 3; do
+
+ mk_aux memdata$t >tests/memtest$t.aux
+
+ case $t in
+ 1) mk_bib 0 >tests/memtest.bib;;
+ 2) mk_bib 1 >>tests/memtest.bib;;
+ 3) exit 0;; # requires larger constatnts
+ esac
+
+ echo "Running memtest$t ..."
+
+ TEXMFCNF=$srcdir/../kpathsea \
+ BSTINPUTS=$srcdir/../web2c/tests \
+ BIBINPUTS=./tests \
+ ./bibtex8 -c $srcdir/csf/88591lat.csf tests/memtest$t || exit 1
+
+done
+
diff --git a/Build/source/texk/bibtex8/tests/sort.test b/Build/source/texk/bibtex8/tests/sort.test
index e8afa6a720b..2c4828c7f48 100755
--- a/Build/source/texk/bibtex8/tests/sort.test
+++ b/Build/source/texk/bibtex8/tests/sort.test
@@ -3,6 +3,8 @@
# Copyright (C) 2010 Peter Breitenlohner <tex-live@tug.org>
# You may freely use, modify and/or distribute this file.
+# Using test data from Philipp Lehman <lehman@gmx.net>
+
test -d tests || mkdir -p tests
cp $srcdir/tests/sort.aux tests/xsort.aux