Hi hackers,

Here's a bugfix for irregex to change this behavior:

#;1> (use irregex)
#;2> (irregex-match 'http-url "http://call-cc.org/foo";)
#<regexp-match (0 submatches)>
#;3> (irregex-match 'http-url "http://call-cc.org/foo/bar";)
#f

into:

#;1> (use irregex)
#;2> (irregex-match 'http-url "http://call-cc.org/foo";)
#<regexp-match (0 submatches)>
#;3> (irregex-match 'http-url "http://call-cc.org/foo/bar";)
#<regexp-match (0 submatches)>

I think this should make it into the next release candidate.
It's already in upstream Irregex.  I'm currently waiting for
a reply from Alex about what to do with userinfo components
(username/password preceding hostname), since http-url doesn't
currently accept those.  But *this* is a more annoying bug.

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth
>From 153c56c731f2166b11197839a8d05f0a1f1db19e Mon Sep 17 00:00:00 2001
From: Peter Bex <[email protected]>
Date: Wed, 15 Aug 2012 21:41:43 +0200
Subject: [PATCH] Trivial bugfix for irregex to make it accept URLs containing
 paths having multiple components (upstream changesets
 aa623d0cbdec and 85cbe4d1565c)

---
 irregex-core.scm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/irregex-core.scm b/irregex-core.scm
index 5b3e80a..25a9c1c 100644
--- a/irregex-core.scm
+++ b/irregex-core.scm
@@ -2299,7 +2299,7 @@
                  (or domain/common ipv4-address) ;; (seq "[" ipv6-address "]")
                  (? ":" (+ numeric)) ;; port
                  ;; path
-                 (? "/" (* url-char)
+                 (? "/" (* (or url-char "/"))
                     (? "?" (* url-char))                      ;; query
                     (? "#" (? (* url-char) url-final-char)) ;; fragment
                     )))
-- 
1.7.9.1

_______________________________________________
Chicken-hackers mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to