From 67d59e4b183264e377e0350a85e98d7ca8c33bac Mon Sep 17 00:00:00 2001 From: adam Date: Fri, 14 May 2004 01:13:07 -0700 Subject: [PATCH] filename trimming for TeX darcs-hash:20040514081307-5007d-a1ffa920f9c63362975b93960739018ba9797f19.gz --- upstream/build/tex/tex.ch | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/upstream/build/tex/tex.ch b/upstream/build/tex/tex.ch index 841f8e9..0a2fe05 100644 --- a/upstream/build/tex/tex.ch +++ b/upstream/build/tex/tex.ch @@ -268,17 +268,17 @@ end; @y @ An external C procedure, |test_access| is used to check whether or not the open will work. It is declared in the ``ext.h'' include file, and it returns -|true| or |false|. The |name_of_file| global holds the file name whose access +|true| or |false|. The |Trim(name_of_file)| global holds the file name whose access is to be tested. The first parameter for |test_access| is the access mode, one of |read_access_mode| or |write_access_mode|. We also implement path searching in |test_access|: its second parameter is -one of the ``file path'' constants defined below. If |name_of_file| +one of the ``file path'' constants defined below. If |Trim(name_of_file)| doesn't start with |'/'| then |test_access| tries prepending pathnames from the appropriate path list until success or the end of path list is reached. -On return, |name_of_file| contains the original name with the path +On return, |Trim(name_of_file)| contains the original name with the path that succeeded (if any) prepended. It is the name used in the various open procedures. @@ -301,7 +301,10 @@ Path searching is not done for output files. @p function a_open_in(var f:alpha_file):boolean; {open a text file for input} -begin reset(f,name_of_file); a_open_in:=IOResult=0; +var str:String; +begin +reset(f,name_of_file); +a_open_in:=IOResult=0; end; @@ -311,7 +314,7 @@ function a_open_out(var f:alpha_file):boolean; {open a text file for output} var @!ok:boolean; begin - rewrite(f,name_of_file); + rewrite(f,Trim(name_of_file)); a_open_out:=true; end; @# @@ -319,7 +322,7 @@ function b_open_in(var f:byte_file):boolean; {open a binary file for input} var @!ok:boolean; begin - reset(f,name_of_file); + reset(f,Trim(name_of_file)); b_open_in:=true; end; @# @@ -327,7 +330,7 @@ function b_open_out(var f:byte_file):boolean; {open a binary file for output} var @!ok:boolean; begin - rewrite(f,name_of_file); + rewrite(f,Trim(name_of_file)); b_open_out:=true; end; @# @@ -335,7 +338,7 @@ function w_open_in(var f:word_file):boolean; {open a word file for input} var @!ok:boolean; begin - reset(f,name_of_file); + reset(f,Trim(name_of_file)); w_open_in:=true; end; @# @@ -343,7 +346,7 @@ function w_open_out(var f:word_file):boolean; {open a word file for output} var @!ok:boolean; begin - rewrite(f,name_of_file); + rewrite(f,Trim(name_of_file)); w_open_out:=true; end; @z -- 1.7.10.4