Annotation of gforth/fixpath.fs, revision 1.5

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: 
        !            23: $CCE0 Constant gforth.exe
        !            24: $C4F0 Constant gforth-fast.exe
        !            25: $89F0 Constant gforth-ditc.exe
        !            26: $6BF0 Constant gforth-itc.exe
        !            27: $6880 Constant gforth-prof.exe
        !            28: 
        !            29: include string.fs
        !            30: 
        !            31: Variable path$  2 arg path$ $!
        !            32: Variable pathes$  2 arg pathes$ $!
        !            33: Variable exe$
        !            34: 
        !            35: pathes$ 1 1 $del
        !            36: s" /cygdrive/" pathes$ 0 $ins
        !            37: : fixpathes ( addr u -- )
        !            38:   bounds ?DO  I c@ '\ = IF  '/ I c!  THEN  LOOP ;
        !            39: pathes$ $@ fixpathes
        !            40: s" .;" pathes$ 0 $ins
        !            41: 
        !            42: : fix-exe ( offset addr u -- )
        !            43:   path$ $@ exe$ $! s" \" exe$ $+! exe$ $+!
        !            44:   exe$ $@ r/w bin open-file throw >r
        !            45:   0 r@ reposition-file throw
        !            46:   pathes$ $@ 2dup + 0 swap c! 1+ r@ write-file throw
        !            47:   r> close-file throw ;
        !            48: 
        !            49: 3 arg evaluate 3 arg fix-exe
        !            50: 
        !            51: bye

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