Hi Hallvard,

Would this help any?
you can replace the " replace/all "this" "this" "
with a "foreach char_block" and "parse cgi (replace cgi "this" "this")
----------------------------------------------------------------------------
------------------

cgi: "state=thread%20s&board=cult.tamaraswift&&sort=T"

char_block: ["=" {: "} "&" {" } { " } " "]
decode_cgi: func [cgi][
           replace/all cgi "%20" " "
          replace/all cgi "=" {: "}
          replace/all cgi "&" {" }
          replace/all cgi { " } " "
          append cgi {"}
         cgi: to-block cgi
cgi_object: make object! cgi

]
decode_cgi cgi
probe cgi_object

----- Original Message -----
From: Hallvard Ystad <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 09, 2004 4:07 PM
Subject: [REBOL] decode-cgi bug (?)


>
> Hi
>
> I know some people say "garbage in - garbage out", but one can't always
control what comes into one's programs as input. Here's what came to one of
mine:
>
>
http://www.bbc.co.uk/cgi-perl/h2/h2.cgi?state=threads&board=cult.tamaraswift
&&sort=T
>
> This crashes 'decode-cgi in /core 2.5.6:
> >> decode-cgi "state=threads&board=cult.tamaraswift&&sort=T"
> ** Script Error: Out of range or past end
> ** Where: to-set-word
> ** Near: to set-word! :value
> >>
>
> I believe Andreas Bolka and/or Andrew Martin made a patch to 'decode-cgi
some time back, but can't seem to find it. Does anyone know whether the
patch fixes this problem? Or perhaps where I can find it?
>
> Thanks,
> HY
>
> Prętera censeo Carthaginem esse delendam
>
>
> --
> To unsubscribe from this list, just send an email to
> [EMAIL PROTECTED] with unsubscribe as the subject.
>


-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.

Reply via email to