Annotation of gforth/fixpath.fs, revision 1.4

1.1       pazsan      1: \ fix path in gforth*.exe
                      2: 
1.3       anton       3: \ Copyright (C) 2000,2003 Free Software Foundation, Inc.
1.2       anton       4: 
                      5: \ This file is part of Gforth.
                      6: 
                      7: \ Gforth is free software; you can redistribute it and/or
                      8: \ modify it under the terms of the GNU General Public License
                      9: \ as published by the Free Software Foundation; either version 2
                     10: \ of the License, or (at your option) any later version.
                     11: 
                     12: \ This program is distributed in the hope that it will be useful,
                     13: \ but WITHOUT ANY WARRANTY; without even the implied warranty of
                     14: \ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     15: \ GNU General Public License for more details.
                     16: 
                     17: \ You should have received a copy of the GNU General Public License
                     18: \ along with this program; if not, write to the Free Software
                     19: \ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
                     20: 
1.1       pazsan     21: ." Fixing " 3 arg type ."  with " 2 arg type cr
                     22: 
                     23: $7410 Constant gforth.exe
                     24: $68D0 Constant gforth-fast.exe
                     25: $81E0 Constant gforth-ditc.exe
1.4     ! pazsan     26: $81E0 Constant gforth-itc.exe
1.1       pazsan     27: 
                     28: include string.fs
                     29: 
                     30: Variable path$  2 arg path$ $!
                     31: Variable pathes$  2 arg pathes$ $!
                     32: Variable exe$
                     33: 
                     34: pathes$ 1 1 $del
                     35: s" //" pathes$ 0 $ins
                     36: : fixpathes ( addr u -- )
                     37:   bounds ?DO  I c@ '\ = IF  '/ I c!  THEN  LOOP ;
                     38: pathes$ $@ fixpathes
                     39: s" .:" pathes$ 0 $ins
                     40: 
                     41: : fix-exe ( offset addr u -- )
                     42:   path$ $@ exe$ $! s" \" exe$ $+! exe$ $+!
                     43:   exe$ $@ r/w bin open-file throw >r
                     44:   0 r@ reposition-file throw
                     45:   pathes$ $@ 2dup + 0 swap c! 1+ r@ write-file throw
                     46:   r> close-file throw ;
                     47: 
                     48: 3 arg evaluate 3 arg fix-exe
                     49: 
                     50: bye

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>