Diff for /gforth/httpd.fs between versions 1.15 and 1.19

version 1.15, 2004/04/10 00:16:55 version 1.19, 2006/04/10 09:23:45
Line 1 Line 1
 #! /usr/local/bin/gforth  #! /usr/local/bin/gforth
   
 \ Copyright (C) 2000,2002,2003 Free Software Foundation, Inc.  \ Copyright (C) 2000,2002,2003,2004 Free Software Foundation, Inc.
   
 \ This file is part of Gforth.  \ This file is part of Gforth.
   
Line 23  warnings off Line 23  warnings off
 require string.fs  require string.fs
   
 Variable DocumentRoot  s" /usr/local/httpd/htdocs/" DocumentRoot $!  Variable DocumentRoot  s" /usr/local/httpd/htdocs/" DocumentRoot $!
 Variable UserDir       s" .html-data/"              UserDir      $!  Variable UserDir       s" public_html/"              UserDir      $!
   
 Variable url  Variable url
 Variable posted  Variable posted
Line 94  Variable maxnum Line 94  Variable maxnum
   
 : ?cr ( -- )  : ?cr ( -- )
   #tib @ 1 >= IF  source 1- + c@ #cr = #tib +!  THEN ;    #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    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 )  : get-input ( -- flag ior )
   s" /nosuchfile" url $!  s" HTTP/1.0" protocol $!    s" /nosuchfile" url $!  s" HTTP/1.0" protocol $!
   s" close" connection $!    s" close" connection $!
Line 112  Variable maxnum Line 112  Variable maxnum
 Variable htmldir  Variable htmldir
   
 : rework-htmldir ( addr u -- addr' u' / ior )  : rework-htmldir ( addr u -- addr' u' / ior )
   htmldir $! htmldir $@ compact.. htmldir $!len drop    htmldir $! htmldir $@ compact-filename htmldir $!len drop
   htmldir $@ s" ../" string-prefix?    htmldir $@ s" ../" string-prefix?
   IF    -1 EXIT  THEN  \ can't access below current directory    IF    -1 EXIT  THEN  \ can't access below current directory
   htmldir $@ s" ~" string-prefix?    htmldir $@ s" ~" string-prefix?

Removed from v.1.15  
changed lines
  Added in v.1.19


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