Annotation of gforth/fixpath.fs, revision 1.7

1.5       pazsan      1: \ fix path in gforth*.exe
                      2: 
                      3: \ Copyright (C) 2000,2003 Free Software Foundation, Inc.
                      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: 
                     21: ." Fixing " 3 arg type ."  with " 2 arg type cr
                     22: 
1.7     ! pazsan     23: $1601C Constant gforth.exe
        !            24: $18E94 Constant gforth-fast.exe
        !            25: $D6C8 Constant gforth-ditc.exe
        !            26: $C8B8 Constant gforth-itc.exe
        !            27: $FD78 Constant gforth-prof.exe
1.5       pazsan     28: 
                     29: include string.fs
                     30: 
                     31: Variable path$  2 arg path$ $!
                     32: Variable pathes$  2 arg pathes$ $!
                     33: Variable exe$
                     34: 
1.6       pazsan     35: \ pathes$ 1 1 $del s" /cygdrive/" pathes$ 0 $ins
                     36: \ : fixpathes ( addr u -- )
                     37: \   bounds ?DO  I c@ '\ = IF  '/ I c!  THEN  LOOP ;
                     38: \ pathes$ $@ fixpathes
1.5       pazsan     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>