Oops, quoting is actually needed by db.postgresql
parent
899b096f90
commit
59dbba09a3
|
@ -3,7 +3,8 @@
|
||||||
USING: multiline kernel sequences io splitting fry namespaces
|
USING: multiline kernel sequences io splitting fry namespaces
|
||||||
http.parsers hashtables assocs combinators ascii io.files.unique
|
http.parsers hashtables assocs combinators ascii io.files.unique
|
||||||
accessors io.encodings.binary io.files byte-arrays math
|
accessors io.encodings.binary io.files byte-arrays math
|
||||||
io.streams.string combinators.short-circuit strings math.order ;
|
io.streams.string combinators.short-circuit strings math.order
|
||||||
|
quoting ;
|
||||||
IN: mime.multipart
|
IN: mime.multipart
|
||||||
|
|
||||||
CONSTANT: buffer-size 65536
|
CONSTANT: buffer-size 65536
|
||||||
|
@ -75,18 +76,6 @@ ERROR: end-of-stream multipart ;
|
||||||
: empty-name? ( string -- ? )
|
: empty-name? ( string -- ? )
|
||||||
{ "''" "\"\"" "" f } member? ;
|
{ "''" "\"\"" "" f } member? ;
|
||||||
|
|
||||||
: quote? ( ch -- ? ) "'\"" member? ;
|
|
||||||
|
|
||||||
: quoted? ( str -- ? )
|
|
||||||
{
|
|
||||||
[ length 1 > ]
|
|
||||||
[ first quote? ]
|
|
||||||
[ [ first ] [ peek ] bi = ]
|
|
||||||
} 1&& ;
|
|
||||||
|
|
||||||
: unquote ( str -- newstr )
|
|
||||||
dup quoted? [ but-last-slice rest-slice >string ] when ;
|
|
||||||
|
|
||||||
: save-uploaded-file ( multipart -- )
|
: save-uploaded-file ( multipart -- )
|
||||||
dup filename>> empty-name? [
|
dup filename>> empty-name? [
|
||||||
drop
|
drop
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Doug Coleman
|
|
@ -0,0 +1,16 @@
|
||||||
|
! Copyright (C) 2009 Doug Coleman.
|
||||||
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
|
USING: sequences math kernel strings combinators.short-circuit ;
|
||||||
|
IN: quoting
|
||||||
|
|
||||||
|
: quote? ( ch -- ? ) "'\"" member? ;
|
||||||
|
|
||||||
|
: quoted? ( str -- ? )
|
||||||
|
{
|
||||||
|
[ length 1 > ]
|
||||||
|
[ first quote? ]
|
||||||
|
[ [ first ] [ peek ] bi = ]
|
||||||
|
} 1&& ;
|
||||||
|
|
||||||
|
: unquote ( str -- newstr )
|
||||||
|
dup quoted? [ but-last-slice rest-slice >string ] when ;
|
Loading…
Reference in New Issue