Fix download-to
parent
948898193c
commit
28182f06f9
|
@ -82,8 +82,8 @@ PRIVATE>
|
||||||
|
|
||||||
: download-to ( url file -- )
|
: download-to ( url file -- )
|
||||||
#! Downloads the contents of a URL to a file.
|
#! Downloads the contents of a URL to a file.
|
||||||
swap http-get-stream check-response
|
swap http-get-stream swap check-response
|
||||||
[ swap binary <file-writer> stream-copy ] with-disposal ;
|
[ swap latin1 <file-writer> stream-copy ] with-disposal ;
|
||||||
|
|
||||||
: download ( url -- )
|
: download ( url -- )
|
||||||
dup download-name download-to ;
|
dup download-name download-to ;
|
||||||
|
|
|
@ -9,7 +9,7 @@ IN: io.encodings.ascii
|
||||||
TUPLE: ascii ;
|
TUPLE: ascii ;
|
||||||
|
|
||||||
M: ascii stream-write-encoded ( string stream encoding -- )
|
M: ascii stream-write-encoded ( string stream encoding -- )
|
||||||
drop 127 encode-check<= ;
|
drop 128 encode-check<= ;
|
||||||
|
|
||||||
M: ascii decode-step
|
M: ascii decode-step
|
||||||
drop dup 128 >= [ decode-error ] [ swap push ] if ;
|
drop dup 128 >= [ decode-error ] [ swap push ] if ;
|
||||||
|
|
|
@ -6,7 +6,7 @@ IN: io.encodings.latin1
|
||||||
TUPLE: latin1 ;
|
TUPLE: latin1 ;
|
||||||
|
|
||||||
M: latin1 stream-write-encoded
|
M: latin1 stream-write-encoded
|
||||||
drop 255 encode-check<= ;
|
drop 256 encode-check<= ;
|
||||||
|
|
||||||
M: latin1 decode-step
|
M: latin1 decode-step
|
||||||
drop dup 256 >= [ decode-error ] [ swap push ] if ;
|
drop swap push ;
|
||||||
|
|
Loading…
Reference in New Issue