From: David Engster Date: Sun, 12 Aug 2012 17:35:15 +0000 (-0400) Subject: * lisp/url/url-util.el (url-file-directory, url-file-nondirectory): Avoid X-Git-Tag: emacs-24.2.90~714 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=577d5eea9a7b6f0cfdf7fafb6d2fdc82e4d702a7;p=emacs.git * lisp/url/url-util.el (url-file-directory, url-file-nondirectory): Avoid file-name-directory and file-name-nondirectory internally. Fixes: debbugs:11981 --- diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 766e45a12e2..815af4e6d43 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,3 +1,8 @@ +2012-08-12 David Engster + + * url-util.el (url-file-directory, url-file-nondirectory): Avoid + file-name-directory and file-name-nondirectory internally (bug#11981). + 2012-08-11 Jason Rumney * url-http.el (url-http-create-request): Use url-http-proxy to @@ -5,7 +10,7 @@ 2012-07-28 David Engster - * url-dav.el (url-dav-supported-p): Added doc-string and remove + * url-dav.el (url-dav-supported-p): Add doc-string and remove check for feature `xml' and function `xml-expand-namespace' which never existed in Emacs proper. (url-dav-process-response): Remove all indentation and newlines @@ -63,8 +68,8 @@ 2012-05-10 Chong Yidong - * url-parse.el (url-path-and-query, url-port-if-non-default): New - functions. + * url-parse.el (url-path-and-query, url-port-if-non-default): + New functions. (url-generic-parse-url): Don't set the portspec slot if it is not specified; that is what `url-port' is for. (url-port): Only require the scheme to be specified to call diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el index 2faca26f2dd..f654830e387 100644 --- a/lisp/url/url-util.el +++ b/lisp/url/url-util.el @@ -247,8 +247,9 @@ Will not do anything if `url-show-status' is nil." (cond ((null file) "") ((string-match "\\?" file) - (file-name-directory (substring file 0 (match-beginning 0)))) - (t (file-name-directory file)))) + (url-file-directory (substring file 0 (match-beginning 0)))) + ((string-match "\\(.*\\(/\\|%2[fF]\\)\\)" file) + (match-string 1 file)))) ;;;###autoload (defun url-file-nondirectory (file) @@ -256,8 +257,10 @@ Will not do anything if `url-show-status' is nil." (cond ((null file) "") ((string-match "\\?" file) - (file-name-nondirectory (substring file 0 (match-beginning 0)))) - (t (file-name-nondirectory file)))) + (url-file-nondirectory (substring file 0 (match-beginning 0)))) + ((string-match ".*\\(?:/\\|%2[fF]\\)\\(.*\\)" file) + (match-string 1 file)) + (t file))) ;;;###autoload (defun url-parse-query-string (query &optional downcase allow-newlines)