diff options
author | Miles Bader <miles@gnu.org> | 2007-10-15 02:07:53 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2007-10-15 02:07:53 +0000 |
commit | b2529d56b5126319a1659dc1530d6fc102cc21d6 (patch) | |
tree | d538297f4ddc6c9200bfed9a1a67ddb479dcc7da /lisp/url/url-util.el | |
parent | decb374a426c8d095d144829791305d91a26b7b7 (diff) | |
parent | 69779ec883ae09f0187aa961930e7b308a71eebb (diff) | |
download | emacs-b2529d56b5126319a1659dc1530d6fc102cc21d6.tar.gz emacs-b2529d56b5126319a1659dc1530d6fc102cc21d6.tar.bz2 emacs-b2529d56b5126319a1659dc1530d6fc102cc21d6.zip |
Merge from emacs--rel--22
Patches applied:
* emacs--rel--22 (patch 116-121)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-889
Diffstat (limited to 'lisp/url/url-util.el')
-rw-r--r-- | lisp/url/url-util.el | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el index 9f73fa435be..119f40b4da4 100644 --- a/lisp/url/url-util.el +++ b/lisp/url/url-util.el @@ -259,18 +259,24 @@ Will not do anything if `url-show-status' is nil." (/ (* x 100) y))) ;;;###autoload -(defun url-basepath (file &optional x) - "Return the base pathname of FILE, or the actual filename if X is true." +(defun url-file-directory (file) + "Return the directory part of FILE, for a URL." (cond ((null file) "") ((string-match (eval-when-compile (regexp-quote "?")) file) - (if x - (file-name-nondirectory (substring file 0 (match-beginning 0))) - (file-name-directory (substring file 0 (match-beginning 0))))) - (x (file-name-nondirectory file)) + (file-name-directory (substring file 0 (match-beginning 0)))) (t (file-name-directory file)))) ;;;###autoload +(defun url-file-nondirectory (file) + "Return the nondirectory part of FILE, for a URL." + (cond + ((null file) "") + ((string-match (eval-when-compile (regexp-quote "?")) file) + (file-name-nondirectory (substring file 0 (match-beginning 0)))) + (t (file-name-nondirectory file)))) + +;;;###autoload (defun url-parse-query-string (query &optional downcase allow-newlines) (let (retval pairs cur key val) (setq pairs (split-string query "&")) @@ -385,7 +391,7 @@ string: \"%\" followed by two lowercase hex digits." If optional variable X is t, then return the basename of the file with the extension stripped off." (if (and fname - (setq fname (url-basepath fname t)) + (setq fname (url-file-nondirectory fname)) (string-match "\\.[^./]+$" fname)) (if x (substring fname 0 (match-beginning 0)) (substring fname (match-beginning 0) nil)) |