--- gforth/httpd.fs 2003/03/09 15:16:50 1.13 +++ gforth/httpd.fs 2004/12/24 14:08:43 1.17 @@ -1,6 +1,6 @@ #! /usr/local/bin/gforth -\ Copyright (C) 2000,2002 Free Software Foundation, Inc. +\ Copyright (C) 2000,2002,2003 Free Software Foundation, Inc. \ This file is part of Gforth. @@ -94,9 +94,9 @@ Variable maxnum : ?cr ( -- ) #tib @ 1 >= IF source 1- + c@ #cr = #tib +! THEN ; -: refill-loop ( -- flag ) +: refill-loop ( -- flag ) base @ >r base off BEGIN refill ?cr WHILE ['] interpret catch drop >in @ 0= UNTIL - true ELSE maxnum off false THEN ; + true ELSE maxnum off false THEN r> base ! ; : get-input ( -- flag ior ) s" /nosuchfile" url $! s" HTTP/1.0" protocol $! s" close" connection $! @@ -112,7 +112,7 @@ Variable maxnum Variable htmldir : rework-htmldir ( addr u -- addr' u' / ior ) - htmldir $! htmldir $@ compact.. htmldir $!len drop + htmldir $! htmldir $@ compact-filename htmldir $!len drop htmldir $@ s" ../" string-prefix? IF -1 EXIT THEN \ can't access below current directory htmldir $@ s" ~" string-prefix? @@ -228,7 +228,7 @@ Defer redirect ( addr u -- ) THEN THEN THEN THEN outfile-id flush-file throw ; : httpd ( n -- ) dup maxnum ! 0 <# #S #> Keep-Alive $! - BEGIN ['] http catch maxnum @ 0= or UNTIL ; + maxnum @ 0 DO ['] http catch maxnum @ 0= or ?LEAVE LOOP ; script? [IF] :noname &100 httpd bye ; is bootmessage [THEN]