[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master f4e7f76 1/2: Fix thinko in setting url-portspec
From: |
Lars Ingebrigtsen |
Subject: |
master f4e7f76 1/2: Fix thinko in setting url-portspec |
Date: |
Sat, 15 Aug 2020 08:20:30 -0400 (EDT) |
branch: master
commit f4e7f7695f4c0f372f606b543afee73f264d6191
Author: Steven Allen <steven@stebalien.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Fix thinko in setting url-portspec
* lisp/url/url-expand.el (url-default-expander): Set
`url-portspec' (bug#42869).
---
lisp/url/url-expand.el | 2 +-
test/lisp/url/url-expand-tests.el | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/lisp/url/url-expand.el b/lisp/url/url-expand.el
index f34ef81..be9b542 100644
--- a/lisp/url/url-expand.el
+++ b/lisp/url/url-expand.el
@@ -120,7 +120,7 @@ path components followed by `..' are removed, along with
the `..' itself."
;; Well, they told us the scheme, let's just go with it.
nil
(setf (url-type urlobj) (or (url-type urlobj) (url-type defobj)))
- (setf (url-port urlobj) (or (url-portspec urlobj)
+ (setf (url-portspec urlobj) (or (url-portspec urlobj)
(and (string= (url-type urlobj)
(url-type defobj))
(url-port defobj))))
diff --git a/test/lisp/url/url-expand-tests.el
b/test/lisp/url/url-expand-tests.el
index 6e0ce86..3b0b6fb 100644
--- a/test/lisp/url/url-expand-tests.el
+++ b/test/lisp/url/url-expand-tests.el
@@ -100,6 +100,13 @@
(should (equal (url-expand-file-name "foo#bar" "http://host/foobar")
"http://host/foo#bar"))
(should (equal (url-expand-file-name "foo#bar" "http://host/foobar/")
"http://host/foobar/foo#bar")))
+(ert-deftest url-expand-file-name/relative-resolution-file-url ()
+ "RFC 3986, Section 5.4 Reference Resolution Examples / Section 5.4.1. Normal
Examples"
+ (should (equal (url-expand-file-name "bar.html"
"file:///a/b/c/foo.html") "file:///a/b/c/bar.html"))
+ (should (equal (url-expand-file-name "bar.html" "file:///a/b/c/")
"file:///a/b/c/bar.html"))
+ (should (equal (url-expand-file-name "../d/bar.html" "file:///a/b/c/")
"file:///a/b/d/bar.html"))
+ (should (equal (url-expand-file-name "../d/bar.html"
"file:///a/b/c/foo.html") "file:///a/b/d/bar.html")))
+
(provide 'url-expand-tests)
;;; url-expand-tests.el ends here