summaryrefslogtreecommitdiff
path: root/lisp/url/url-parse.el
diff options
context:
space:
mode:
authorAlain Schneble <a.s@realize.ch>2015-12-26 00:50:25 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2015-12-26 00:50:25 +0100
commitb792ecea1715e080ad8e232d3d154b8a25d2edfb (patch)
tree5b0408a86822ea31104518f6d730ec886e86645e /lisp/url/url-parse.el
parent1dee11d874de5ff3d5634e1629054c4398b27b72 (diff)
downloademacs-b792ecea1715e080ad8e232d3d154b8a25d2edfb.tar.gz
emacs-b792ecea1715e080ad8e232d3d154b8a25d2edfb.tar.bz2
emacs-b792ecea1715e080ad8e232d3d154b8a25d2edfb.zip
Make relative URL parsing and resolution consistent with RFC 3986 (bug#22044)
* test/lisp/url/url-parse-tests.el: Add tests covering url-generic-parse-url. * test/lisp/url/url-expand-tests.el: Add tests covering url-expand-file-name. * lisp/url/url-parse.el (url-generic-parse-url): Keep empty fragment information in URL-struct. * lisp/url/url-parse.el (url-path-and-query): Do not artificially turn empty path and query into nil path and query, respectively. * lisp/url/url-expand.el (url-expander-remove-relative-links): Do not turn empty path into an absolute ("/") path. * lisp/url/url-expand.el (url-expand-file-name): Properly resolve fragment-only URIs. Do not just return them unchanged. * lisp/url/url-expand.el (url-default-expander): An empty path in the relative reference URI should not drop the last segment.
Diffstat (limited to 'lisp/url/url-parse.el')
-rw-r--r--lisp/url/url-parse.el5
1 files changed, 1 insertions, 4 deletions
diff --git a/lisp/url/url-parse.el b/lisp/url/url-parse.el
index dbf0c386871..c3159a7e103 100644
--- a/lisp/url/url-parse.el
+++ b/lisp/url/url-parse.el
@@ -59,8 +59,6 @@ where each of PATH and QUERY are strings or nil."
(setq path (substring name 0 (match-beginning 0))
query (substring name (match-end 0)))
(setq path name)))
- (if (equal path "") (setq path nil))
- (if (equal query "") (setq query nil))
(cons path query)))
(defun url-port-if-non-default (urlobj)
@@ -217,8 +215,7 @@ parses to
(when (looking-at "#")
(let ((opoint (point)))
(forward-char 1)
- (unless (eobp)
- (setq fragment (buffer-substring (point) (point-max))))
+ (setq fragment (buffer-substring (point) (point-max)))
(delete-region opoint (point-max)))))
(if (and host (string-match "%[0-9][0-9]" host))