Fix download-to

db4
dharmatech 2008-03-07 23:47:11 -06:00
parent 948898193c
commit 28182f06f9
3 changed files with 5 additions and 5 deletions
extra
http/client
io/encodings

View File

@ -82,8 +82,8 @@ PRIVATE>
: download-to ( url file -- )
#! Downloads the contents of a URL to a file.
swap http-get-stream check-response
[ swap binary <file-writer> stream-copy ] with-disposal ;
swap http-get-stream swap check-response
[ swap latin1 <file-writer> stream-copy ] with-disposal ;
: download ( url -- )
dup download-name download-to ;

View File

@ -9,7 +9,7 @@ IN: io.encodings.ascii
TUPLE: ascii ;
M: ascii stream-write-encoded ( string stream encoding -- )
drop 127 encode-check<= ;
drop 128 encode-check<= ;
M: ascii decode-step
drop dup 128 >= [ decode-error ] [ swap push ] if ;

View File

@ -6,7 +6,7 @@ IN: io.encodings.latin1
TUPLE: latin1 ;
M: latin1 stream-write-encoded
drop 255 encode-check<= ;
drop 256 encode-check<= ;
M: latin1 decode-step
drop dup 256 >= [ decode-error ] [ swap push ] if ;
drop swap push ;