--- gforth/locate.fs 2001/10/07 21:51:09 1.1 +++ gforth/locate.fs 2007/12/31 19:02:24 1.6 @@ -1,5 +1,22 @@ \ locate, using the TAGS file +\ Copyright (C) 2002,2003,2007 Free Software Foundation, Inc. + +\ This file is part of Gforth. + +\ Gforth is free software; you can redistribute it and/or +\ modify it under the terms of the GNU General Public License +\ as published by the Free Software Foundation, either version 3 +\ of the License, or (at your option) any later version. + +\ This program is distributed in the hope that it will be useful, +\ but WITHOUT ANY WARRANTY; without even the implied warranty of +\ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +\ GNU General Public License for more details. + +\ You should have received a copy of the GNU General Public License +\ along with this program. If not, see http://www.gnu.org/licenses/. + require string.fs Variable last-file @@ -36,7 +53,7 @@ Variable sys-buf : locate ( "name" -- ) s" " last-file $! bl sword s" TAGS" r/o open-file throw >r BEGIN r@ tag-line WHILE - s" " line-buf $@ compare 0= + s" " line-buf $@ str= IF r@ get-file ELSE 2dup check-word IF print-location 2drop r> close-file throw EXIT THEN