[REBOL] path-thru patch can return a directory
From: anton:lexicon at: 7-Jul-2002 21:23
; patch path-thru so it can return a directory
path-thru: func [url /local purl][
if file? url [return url]
if not all [purl: decode-url url purl/host] [return none]
rejoin [view-root/public slash purl/host slash any [purl/path ""] any
[purl/target ""]]
]
Here's the original source for comparison:
path-thru: func [url /local purl][
if file? url [return url]
if not all [purl: decode-url url purl/target purl/host] [return none]
rejoin [view-root/public slash purl/host slash any [purl/path ""]
purl/target]
]
In the following examples, the original path-thru returns none.
Kind of irritating. The patched version returns what I would
expect.
path-thru http://somewhere.com ; no path and no target
path-thru http://somewhere.com/adir/ ; no target
Anton.