From ac9f0b75eb3a7fb50226cda2cfa1980c2df2b429 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Mon, 14 May 2012 09:56:04 +0200 Subject: [PATCH] Make URL redirection work again. The previous changes would make redirection fail, since the expansion would end up with URLs that looked like "http:www.bing.com/hello". * url-expand.el (url-default-expander): Copy over the fullness of the new URL object based on the definition URL object. --- lisp/url/ChangeLog | 5 +++++ lisp/url/url-expand.el | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index c41df0e832b..87f2cfe5019 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,3 +1,8 @@ +2012-05-14 Lars Magne Ingebrigtsen + + * url-expand.el (url-default-expander): Copy over the fullness of + the new URL object based on the definition URL object. + 2012-05-10 Chong Yidong * url-parse.el (url-path-and-query, url-port-if-non-default): New diff --git a/lisp/url/url-expand.el b/lisp/url/url-expand.el index 156b06c895b..e5c795969aa 100644 --- a/lisp/url/url-expand.el +++ b/lisp/url/url-expand.el @@ -116,13 +116,17 @@ path components followed by `..' are removed, along with the `..' itself." (setf (url-port urlobj) (or (url-port urlobj) (and (string= (url-type urlobj) (url-type defobj)) - (url-port defobj)))) + (url-port defobj)))) (if (not (string= "file" (url-type urlobj))) (setf (url-host urlobj) (or (url-host urlobj) (url-host defobj)))) (if (string= "ftp" (url-type urlobj)) (setf (url-user urlobj) (or (url-user urlobj) (url-user defobj)))) (if (string= (url-filename urlobj) "") (setf (url-filename urlobj) "/")) + ;; If the object we're expanding from is full, then we are now + ;; full. + (unless (url-fullness urlobj) + (setf (url-fullness urlobj) (url-fullness defobj))) (if (string-match "^/" (url-filename urlobj)) nil (let ((query nil) -- 2.39.2