summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-02-11 00:26:00 +0000
committerKarl Berry <karl@freefriends.org>2008-02-11 00:26:00 +0000
commit186b4bd189ff36cf2a248f65f2d2306767708f72 (patch)
treee3cb09277f01ca117240f4efbdf42a1cd431275b /Build
parent8d9b04994b3cb50b5c1abf3ffb7fa4452d9f1212 (diff)
avoid clobbering globals in make_name_string
git-svn-id: svn://tug.org/texlive/trunk@6604 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/ChangeLog9
-rw-r--r--Build/source/texk/web2c/tex.ch26
2 files changed, 29 insertions, 6 deletions
diff --git a/Build/source/texk/web2c/ChangeLog b/Build/source/texk/web2c/ChangeLog
index 16a808f6d6a..c68c0328d31 100644
--- a/Build/source/texk/web2c/ChangeLog
+++ b/Build/source/texk/web2c/ChangeLog
@@ -1,3 +1,12 @@
+2008-02-11 Karl Berry <karl@tug.org>
+
+ * tex.ch (make_name_string): avoid clobbering globals via
+ This is TeX ...
+ **abc%
+ *de
+ From Akira and Jonathan Kew, tex-implementors 02 Feb 2008 20:42:18
+ et al.
+
2008-01-29 Peter Breitenlohner <peb@mppmu.mpg.de>
Convert from autoconf-2.13 to autoconf-2.59+:
diff --git a/Build/source/texk/web2c/tex.ch b/Build/source/texk/web2c/tex.ch
index 2626b237831..44fd493209c 100644
--- a/Build/source/texk/web2c/tex.ch
+++ b/Build/source/texk/web2c/tex.ch
@@ -2221,22 +2221,36 @@ name_of_file[name_length+1]:=0;
@z
@x [29.525] l.10163 - make_name_string
+@p function make_name_string:str_number;
+var k:1..file_name_size; {index into |name_of_file|}
+begin if (pool_ptr+name_length>pool_size)or(str_ptr=max_strings)or
+ (cur_length>0) then
+ make_name_string:="?"
+else begin for k:=1 to name_length do append_char(xord[name_of_file[k]]);
make_name_string:=make_string;
end;
@y
+@p function make_name_string:str_number;
+var k:1..file_name_size; {index into |name_of_file|}
+save_area_delimiter, save_ext_delimiter: pool_pointer;
+save_name_in_progress, save_stop_at_space: boolean;
+begin if (pool_ptr+name_length>pool_size)or(str_ptr=max_strings)or
+ (cur_length>0) then
+ make_name_string:="?"
+else begin for k:=1 to name_length do append_char(xord[name_of_file[k]]);
make_name_string:=make_string;
end;
{At this point we also set |cur_name|, |cur_ext|, and |cur_area| to
match the contents of |name_of_file|.}
- k:=1;
+ save_area_delimiter:=area_delimiter; save_ext_delimiter:=ext_delimiter;
+ save_name_in_progress:=name_in_progress; save_stop_at_space:=stop_at_space;
name_in_progress:=true;
- begin_name;
stop_at_space:=false;
while (k<=name_length)and(more_name(name_of_file[k])) do
- incr(k);
- stop_at_space:=true;
- end_name;
- name_in_progress:=false;
+ begin incr(k); append_char(xord[name_of_file[k]]); end;
+ stop_at_space:=save_stop_at_space;
+ name_in_progress:=save_name_in_progress;
+ area_delimiter:=save_area_delimiter; ext_delimiter:=save_ext_delimiter;
@z
@x [29.526] l.10194 - stop scanning file name if we're at end-of-line.