From cbc1cd0c0fa2ce847278e354fb17358519ad42d6 Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Mon, 22 Mar 2010 15:42:34 +0000 Subject: bibtex/bibtex8/bibtexu: bug fix and more updates git-svn-id: svn://tug.org/texlive/trunk@17528 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/bibtex8/ChangeLog | 6 +++++- Build/source/texk/bibtex8/bibtex-3.c | 2 +- Build/source/texk/bibtex8/bibtex-4.c | 5 +++-- Build/source/texk/bibtex8/bibtex.h | 2 +- Build/source/texk/bibtex8/tests/bibtex-mem.test | 10 ++++++++-- Build/source/texk/bibtex8/utils.c | 14 ++++++++++++++ 6 files changed, 32 insertions(+), 7 deletions(-) (limited to 'Build/source/texk/bibtex8') diff --git a/Build/source/texk/bibtex8/ChangeLog b/Build/source/texk/bibtex8/ChangeLog index 332251eebb1..195e05f8fd3 100644 --- a/Build/source/texk/bibtex8/ChangeLog +++ b/Build/source/texk/bibtex8/ChangeLog @@ -1,7 +1,11 @@ 2010-03-19 Peter Breitenlohner + * utils.c: Default csfile and Max_Strings from env or config. * bibtex.c: Call kpse_set_program_name with "bibtex8". - * utils.c: Default csfile from environment or config file. + * bibtex.h (STR_ROOM): Call pool_overflow() as often as needed. + * bibtex-3.c (scan_fn_def): Same for increase Wiz_Fn_Space. + * bibtex-4.c (BST_STRING_SIZE_EXCEEDED): Drop extra "%ld". + (x_text_prefix): Add missing STR_ROOM. 2010-03-18 Peter Breitenlohner diff --git a/Build/source/texk/bibtex8/bibtex-3.c b/Build/source/texk/bibtex8/bibtex-3.c index 75e5ad208e5..308cbed1425 100644 --- a/Build/source/texk/bibtex8/bibtex-3.c +++ b/Build/source/texk/bibtex8/bibtex-3.c @@ -2054,7 +2054,7 @@ Next_Token_Label: ***************************************************************************/ BEGIN INSERT_FN_LOC (END_OF_DEF); - if ((single_ptr + wiz_def_ptr) > Wiz_Fn_Space) + while ((single_ptr + wiz_def_ptr) > Wiz_Fn_Space) BEGIN BIB_XRETALLOC ("wiz_functions", wiz_functions, HashPtr2_T, Wiz_Fn_Space, Wiz_Fn_Space + WIZ_FN_SPACE); diff --git a/Build/source/texk/bibtex8/bibtex-4.c b/Build/source/texk/bibtex8/bibtex-4.c index 1627614cb59..07cf8d0f0e7 100644 --- a/Build/source/texk/bibtex8/bibtex-4.c +++ b/Build/source/texk/bibtex8/bibtex-4.c @@ -1316,7 +1316,7 @@ BEGIN sp_xptr1 = str_start[pop_lit2 + 1]; if ((sp_xptr1 - sp_ptr) > ENT_STR_SIZE) BEGIN - BST_STRING_SIZE_EXCEEDED (ENT_STR_SIZE, "%ld, the entry"); + BST_STRING_SIZE_EXCEEDED (ENT_STR_SIZE, ", the entry"); sp_xptr1 = sp_ptr + ENT_STR_SIZE; END while (sp_ptr < sp_xptr1) @@ -1378,7 +1378,7 @@ BEGIN sp_end = str_start[pop_lit2 + 1]; if ((sp_end - sp_ptr) > GLOB_STR_SIZE) BEGIN - BST_STRING_SIZE_EXCEEDED (GLOB_STR_SIZE, "%ld, the global"); + BST_STRING_SIZE_EXCEEDED (GLOB_STR_SIZE, ", the global"); sp_end = sp_ptr + GLOB_STR_SIZE; END while (sp_ptr < sp_end) @@ -2251,6 +2251,7 @@ BEGIN END /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 445 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ + STR_ROOM (sp_brace_level + sp_end - sp_ptr); if (pop_lit2 >= cmd_str_ptr) BEGIN pool_ptr = sp_end; diff --git a/Build/source/texk/bibtex8/bibtex.h b/Build/source/texk/bibtex8/bibtex.h index dd5dbf1fb13..ae6ef197af3 100644 --- a/Build/source/texk/bibtex8/bibtex.h +++ b/Build/source/texk/bibtex8/bibtex.h @@ -467,7 +467,7 @@ ***************************************************************************/ #define APPEND_CHAR(X) {str_pool[pool_ptr] = (X);\ INCR(pool_ptr);} -#define STR_ROOM(X) {if((pool_ptr+(X))>Pool_Size)\ +#define STR_ROOM(X) {while((pool_ptr+(X))>Pool_Size)\ pool_overflow();} /*************************************************************************** diff --git a/Build/source/texk/bibtex8/tests/bibtex-mem.test b/Build/source/texk/bibtex8/tests/bibtex-mem.test index 2c0d883516b..19d50f6c402 100755 --- a/Build/source/texk/bibtex8/tests/bibtex-mem.test +++ b/Build/source/texk/bibtex8/tests/bibtex-mem.test @@ -50,15 +50,21 @@ for t in 1 2 3; do case $t in 1) mk_bib 0 >tests/memtest.bib;; 2) mk_bib 1 >>tests/memtest.bib;; - 3) exit 0;; # requires larger constatnts + 3) exit 0;; # requires larger constants esac +# memtest3 requires: +# SINGLE_FN_SPACE 200 (100) +# ENT_STR_SIZE 2000 (250) +# GLOB_STR_SIZE 2000 (1000) +# MAX_GLOB_STRS 50 (10) + echo "Running memtest$t ..." TEXMFCNF=$srcdir/../kpathsea \ BSTINPUTS=$srcdir/../web2c/tests:$srcdir/csf \ BIBINPUTS=./tests \ - ./bibtex8 tests/memtest$t || exit 1so + ./bibtex8 tests/memtest$t || exit 1 done diff --git a/Build/source/texk/bibtex8/utils.c b/Build/source/texk/bibtex8/utils.c index 685c3ce1f67..17e853015d7 100644 --- a/Build/source/texk/bibtex8/utils.c +++ b/Build/source/texk/bibtex8/utils.c @@ -1283,6 +1283,20 @@ void set_array_sizes (void) Max_Strings = 4000; Min_Crossrefs = 2; + { + char *expansion = kpse_var_value ("max_strings"); + if (expansion) { + int conf_val = atoi (expansion); + if (conf_val < Max_Strings) + fprintf (stderr, + "%s: Bad value (%ld) in texmf.cnf for max_strings, keeping %ld.\n", + program_invocation_name, (long) conf_val, (long) Max_Strings); + else + Max_Strings = conf_val; + free (expansion); + } + } + if (Flag_big) { Max_Strings = 10000; } -- cgit v1.2.3