Tk Library Source Code

Artifact [a40002cff3]
Login

Artifact a40002cff3bc1b487cb8e2b59ed4d573a1db2753:

Attachment "latest2.diff" to ticket [638075ffff] added by davidw 2002-11-14 07:36:33.
? latest.diff
? latest2.diff
Index: uri.tcl
===================================================================
RCS file: /cvsroot/tcllib/tcllib/modules/uri/uri.tcl,v
retrieving revision 1.15
diff -u -r1.15 uri.tcl
--- uri.tcl	26 Feb 2002 04:59:44 -0000	1.15
+++ uri.tcl	14 Nov 2002 00:34:33 -0000
@@ -350,7 +350,13 @@
 
     regsub -- {^/} $components(path) {} components(path)
 
-    return $scheme://$components(host)$port/$components(path)$query
+    if { [info exists components(fragment)] && $components(fragment) != "" } {
+	set components(fragment) "#$components(fragment)"
+    } else {
+	set components(fragment) ""
+    }
+
+    return $scheme://$components(host)$port/$components(path)$components(fragment)$query
 }
 
 proc uri::SplitFile {url} {
Index: uri.test
===================================================================
RCS file: /cvsroot/tcllib/tcllib/modules/uri/uri.test,v
retrieving revision 1.11
diff -u -r1.11 uri.test
--- uri.test	5 Jun 2002 22:59:07 -0000	1.11
+++ uri.test	14 Nov 2002 00:34:33 -0000
@@ -362,6 +379,10 @@
     uri::canonicalize telnet://goo.test.net/
 } telnet://goo.test.net/
 
+test uri-7.0 {uri::split & uri::join} {
+    set ls [uri::split http://tcl.apache.org/websh/faq.ws3\#generic?foo=bar]
+    eval uri::join $ls
+} {http://tcl.apache.org/websh/faq.ws3#generic?foo=bar}
 
 # -------------------------------------------------------------------------