From 76fb5862cd8e4b629259544fa7a9a02476663a66 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 13 Oct 2007 14:02:50 +0000 Subject: (url-basepath): Function deleted. (url-file-directory, url-file-nondirectory): New functions replacing url-basepath. Callers changed. --- lisp/url/url-util.el | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'lisp/url/url-util.el') diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el index 082ceaea416..d7d8e2b4a4b 100644 --- a/lisp/url/url-util.el +++ b/lisp/url/url-util.el @@ -259,17 +259,23 @@ 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) @@ -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)) -- cgit v1.2.1