diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2010-04-22 08:12:50 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2010-04-22 08:12:50 +0000 |
commit | 3c4e319b047a8eb727b15613680783c401085106 (patch) | |
tree | f36eede64b5966b63919a986d21f17bb5c5b811f | |
parent | 721c5a9a097833f964cbc2084b105379648baf04 (diff) |
minor [p]bibtex fixes
git-svn-id: svn://tug.org/texlive/trunk@17957 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/texk/web2c/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/bibtex.ch | 35 | ||||
-rw-r--r-- | Build/source/texk/web2c/ptexdir/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/ptexdir/pbibtex.ch | 85 |
4 files changed, 21 insertions, 108 deletions
diff --git a/Build/source/texk/web2c/ChangeLog b/Build/source/texk/web2c/ChangeLog index 0a7c975f6db..fcda8873285 100644 --- a/Build/source/texk/web2c/ChangeLog +++ b/Build/source/texk/web2c/ChangeLog @@ -1,3 +1,8 @@ +2010-04-21 Peter Breitenlohner <peb@mppmu.mpg.de> + + * bibtex.ch: Fix a small bug (duplicate entry) in bibtex.web. + (add_out_pool): Call buffer_overflow as often as needed. + 2010-04-20 Peter Breitenlohner <peb@mppmu.mpg.de> * texmfmem.h, texmfmp-help.h: Remove luaTeX specific code. diff --git a/Build/source/texk/web2c/bibtex.ch b/Build/source/texk/web2c/bibtex.ch index 8a4a7bc7784..1832185d6a7 100644 --- a/Build/source/texk/web2c/bibtex.ch +++ b/Build/source/texk/web2c/bibtex.ch @@ -1342,35 +1342,13 @@ entry_strs := XTALLOC ((num_ent_strs + 1) * (num_cites + 1) * (ent_str_size + 1) @z @x [321] Dynamic buf_size. +if (out_buf_length+(p_ptr2-p_ptr1) > buf_size) then overflow('output buffer size ',buf_size); @y +while (out_buf_length+(p_ptr2-p_ptr1) > buf_size) do buffer_overflow; @z -% We shouldn't try to split a \% combo, as the result is an escaped % at -% end-of-line, and a line beginning with a %, which leads to rest being -% ignored. This is a special case of the general problem that we shouldn't -% split macro invocations either -- however, the best way to avoid that is -% not to split lines at all. -% @x [324] Check whether we're trying to break a \% combo. -% out_buf[end_ptr] := out_buf[max_print_line-1]; {save this character} -% out_buf[max_print_line-1] := comment; {so \TeX\ does the thing right} -% out_buf_length := max_print_line; -% break_ptr := out_buf_length - 1; {the `|-1|' allows for the restoration} -% output_bbl_line; {output what we can,} -% out_buf[max_print_line-1] := out_buf[end_ptr]; {restore this character} -% @y -% if out_buf[max_print_line-1] = comment then {assume \% combo here} -% out_buf_length := max_print_line - 1 -% else -% out_buf_length := max_print_line; -% break_ptr := out_buf_length - 1; {the `|-1|' allows for the restoration} -% out_buf[end_ptr] := out_buf[break_ptr]; {save this character} -% out_buf[break_ptr] := comment; {so \TeX\ does the thing right} -% output_bbl_line; {output what we can,} -% out_buf[break_ptr] := out_buf[end_ptr]; {restore this character} -% @z - @x [328] Add check for fieldinfo[] overflow. field_ptr := cite_ptr*num_fields + fn_info[ex_fn_loc]; @y @@ -1395,6 +1373,15 @@ entry_strs := XTALLOC ((num_ent_strs + 1) * (num_cites + 1) * (ent_str_size + 1) append_char (x_global_strs(str_glb_ptr)(glob_chr_ptr)); @z +@x [335] Bug fix: remove duplicate entry. +build_in('width$ ',6,b_width,n_width); +build_in('while$ ',6,b_while,n_while); +build_in('width$ ',6,b_width,n_width); +@y +build_in('while$ ',6,b_while,n_while); +build_in('width$ ',6,b_width,n_width); +@z + @x [338] s_preamble is dynamically allocated. @!s_preamble : array[bib_number] of str_number; @y diff --git a/Build/source/texk/web2c/ptexdir/ChangeLog b/Build/source/texk/web2c/ptexdir/ChangeLog index 63d83ecd5cb..ce62278d2bf 100644 --- a/Build/source/texk/web2c/ptexdir/ChangeLog +++ b/Build/source/texk/web2c/ptexdir/ChangeLog @@ -4,6 +4,10 @@ for basic 'make check' tests. * am/ptex.am: Add these tests. + * pbibtex.ch: Adapt to change (bug fix) in ../bibtex.ch. + Remove kanji fix of workaround from ../bibtex.ch for breaking + long lines in module 324; all that is gone with bibtex-0.99d. + 2010-04-17 Peter Breitenlohner <peb@mppmu.mpg.de> * ppltotf.ch: Rename PTEX_PLTOTF_HELP => PPLTOTF_HELP. diff --git a/Build/source/texk/web2c/ptexdir/pbibtex.ch b/Build/source/texk/web2c/ptexdir/pbibtex.ch index 184f504c087..b1cede95c60 100644 --- a/Build/source/texk/web2c/ptexdir/pbibtex.ch +++ b/Build/source/texk/web2c/ptexdir/pbibtex.ch @@ -216,95 +216,21 @@ begin @<Process a possible command line@> @z -@x Changes for JBibTeX by Shouichi Matsui [321] -procedure add_out_pool (@!p_str : str_number); -label loop1_exit,loop2_exit; -var break_ptr : buf_pointer; {the first character following the line break} -@!end_ptr : buf_pointer; {temporary end-of-buffer pointer} -break_pt_found : boolean; {a suitable |white_space| character} -unbreakable_tail : boolean; {as it contains no |white_space| character} -@y -procedure add_out_pool (@!p_str : str_number); -label loop1_exit,loop2_exit; -var break_ptr : buf_pointer; {the first character following the line break} -@!end_ptr : buf_pointer; {temporary end-of-buffer pointer} -break_pt_found : boolean; {a suitable |white_space| character} -unbreakable_tail : boolean; {because it contains no |white_space| character} -@!in_mid_kanji:boolean; {flag if |max_print_line|-1 is in mid kanji} -@!last_char_ptr : buf_pointer; -@!t : buf_pointer; -@z - -@x Changes for JBibTeX by Shouichi Matsui [324] -@<Break that unbreakably long line@>= -begin -out_buf_ptr := max_print_line + 1; {|break_pt_found| is still |false|} -while (out_buf_ptr < end_ptr) do - if (lex_class[out_buf[out_buf_ptr]] <> white_space) then - incr(out_buf_ptr) - else - goto loop1_exit; -loop1_exit: -if (out_buf_ptr = end_ptr) then - unbreakable_tail := true {because no |white_space| character} -else {at |white_space|, and |out_buf_ptr < end_ptr|} - begin - break_pt_found := true; - while (out_buf_ptr+1 < end_ptr) do {look for more |white_space|} - if (lex_class[out_buf[out_buf_ptr+1]] = white_space) then - incr(out_buf_ptr) {which then points to |white_space|} - else - goto loop2_exit; -loop2_exit: - end; -end -@y -@<Break that unbreakably long line@>= -begin -@<Check if |max_print_line|-1 is in mid kanji@>; -if in_mid_kanji then last_char_ptr:=max_print_line-1 - else last_char_ptr:=max_print_line; -out_buf[end_ptr] := out_buf[last_char_ptr-1]; {save this character} -out_buf[last_char_ptr-1] := comment; {so \TeX\ does the thing right} -out_buf_length := last_char_ptr; -break_ptr := out_buf_length - 1; {the `|-1|' allows for the restoration} -output_bbl_line; {output what we can,} -out_buf[last_char_ptr-1] := out_buf[end_ptr]; {restore this character} -out_buf_ptr := 0; -tmp_ptr := break_ptr; -while (tmp_ptr < end_ptr) do {and slide the rest down} - begin - out_buf[out_buf_ptr] := out_buf[tmp_ptr]; - incr(out_buf_ptr); - incr(tmp_ptr); - end; -out_buf_length := end_ptr - break_ptr; -end -@z - @x Changes for JBibTeX by Shouichi Matsui [332] -@!b_while : hash_loc; {\.{while\$}} -@!b_width : hash_loc; {\.{width\$}} @!b_write : hash_loc; {\.{write\$}} @!b_default : hash_loc; {either \.{skip\$} or \.{default.type}} @y -@!b_while : hash_loc; {\.{while\$}} -@!b_width : hash_loc; {\.{width\$}} @!b_write : hash_loc; {\.{write\$}} -@!b_default : hash_loc; {either \.{skip\$} or \.{default.type}} @!b_is_kanji_str : hash_loc; {\.{is.kanji.str\$}} +@!b_default : hash_loc; {either \.{skip\$} or \.{default.type}} @z @x Changes for JBibTeX by Shouichi Matsui [334] -@d n_while = 34 {\.{while\$}} -@d n_width = 35 {\.{width\$}} @d n_write = 36 {\.{write\$}} @<Constants in the outer block@>= @!num_blt_in_fns = 37; {one more than the previous number} @y -@d n_while = 34 {\.{while\$}} -@d n_width = 35 {\.{width\$}} @d n_write = 36 {\.{write\$}} @d n_is_kanji_str = 37 {\.{is.kanji.str\$}} @@ -313,25 +239,18 @@ end @z @x Changes for JBibTeX by Shouichi Matsui [335] -build_in('width$ ',6,b_width,n_width); -build_in('while$ ',6,b_while,n_while); -build_in('width$ ',6,b_width,n_width); build_in('write$ ',6,b_write,n_write); @y -build_in('while$ ',6,b_while,n_while); -build_in('width$ ',6,b_width,n_width); build_in('write$ ',6,b_write,n_write); build_in('is.kanji.str$',13,b_is_kanji_str,n_is_kanji_str); @z @x Changes for JBibTeX by Shouichi Matsui [342] - n_width : x_width; n_write : x_write; othercases confusion ('Unknown built-in function') endcases; end @y - n_width : x_width; n_write : x_write; n_is_kanji_str: x_is_kanji_str; othercases confusion ('Unknown built-in function') @@ -340,11 +259,9 @@ end @z @x Changes for JBibTeX by Shouichi Matsui [343] -@<|execute_fn|({\.{width\$}})@>@; @<|execute_fn|({\.{write\$}})@>@; @<|execute_fn| itself@> @y -@<|execute_fn|({\.{width\$}})@>@; @<|execute_fn|({\.{write\$}})@>@; @<|execute_fn|({\.{is.kanji.str\$}})@>@; @<|execute_fn| itself@> |