diff lisp/url/url-auth.el @ 85311:591c29778a30

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
author Miles Bader <miles@gnu.org>
date Mon, 15 Oct 2007 02:07:53 +0000
parents 7d0c6a0340a2 de62e8014967
children 107ccd98fa12
line wrap: on
line diff
--- a/lisp/url/url-auth.el	Mon Oct 15 00:23:32 2007 +0000
+++ b/lisp/url/url-auth.el	Mon Oct 15 02:07:53 2007 +0000
@@ -61,22 +61,22 @@
 to use for the url and its descendants.  If optional third argument
 OVERWRITE is non-nil, overwrite the old username/password pair if it
 is found in the assoc list.  If REALM is specified, use that as the realm
-instead of the pathname inheritance method."
+instead of the filename inheritance method."
   (let* ((href (if (stringp url)
 		   (url-generic-parse-url url)
 		 url))
 	 (server (url-host href))
 	 (port (url-port href))
-	 (path (url-filename href))
+	 (file (url-filename href))
 	 (user (url-user href))
 	 (pass (url-password href))
 	 byserv retval data)
     (setq server (format "%s:%d" server port)
-	  path (cond
+	  file (cond
 		(realm realm)
-		((string= "" path) "/")
-		((string-match "/$" path) path)
-		(t (url-basepath path)))
+		((string= "" file) "/")
+		((string-match "/$" file) file)
+		(t (url-file-directory file)))
 	  byserv (cdr-safe (assoc server
 				  (symbol-value url-basic-auth-storage))))
     (cond
@@ -86,21 +86,21 @@
 	    pass (read-passwd "Password: " nil (or pass "")))
       (set url-basic-auth-storage
 	   (cons (list server
-		       (cons path
+		       (cons file
 			     (setq retval
 				   (base64-encode-string
 				    (format "%s:%s" user pass)))))
 		 (symbol-value url-basic-auth-storage))))
      (byserv
-      (setq retval (cdr-safe (assoc path byserv)))
+      (setq retval (cdr-safe (assoc file byserv)))
       (if (and (not retval)
-	       (string-match "/" path))
+	       (string-match "/" file))
  	  (while (and byserv (not retval))
 	    (setq data (car (car byserv)))
 	    (if (or (not (string-match "/" data)) ; It's a realm - take it!
 		    (and
-		     (>= (length path) (length data))
-		     (string= data (substring path 0 (length data)))))
+		     (>= (length file) (length data))
+		     (string= data (substring file 0 (length data)))))
 		(setq retval (cdr (car byserv))))
 	    (setq byserv (cdr byserv))))
       (if (or (and (not retval) prompt) overwrite)
@@ -111,7 +111,7 @@
 		  retval (base64-encode-string (format "%s:%s" user pass))
 		  byserv (assoc server (symbol-value url-basic-auth-storage)))
 	    (setcdr byserv
-		    (cons (cons path retval) (cdr byserv))))))
+		    (cons (cons file retval) (cdr byserv))))))
      (t (setq retval nil)))
     (if retval (setq retval (concat "Basic " retval)))
     retval))
@@ -153,12 +153,12 @@
 		     url))
 	     (server (url-host href))
 	     (port (url-port href))
-	     (path (url-filename href))
+	     (file (url-filename href))
 	     user pass byserv retval data)
-	(setq path (cond
+	(setq file (cond
 		    (realm realm)
-		    ((string-match "/$" path) path)
-		    (t (url-basepath path)))
+		    ((string-match "/$" file) file)
+		    (t (url-file-directory file)))
 	      server (format "%s:%d" server port)
 	      byserv (cdr-safe (assoc server url-digest-auth-storage)))
 	(cond
@@ -168,7 +168,7 @@
 		pass (read-passwd "Password: ")
 		url-digest-auth-storage
 		(cons (list server
-			    (cons path
+			    (cons file
 				  (setq retval
 					(cons user
 					      (url-digest-auth-create-key
@@ -177,15 +177,15 @@
 					       url)))))
 		      url-digest-auth-storage)))
 	 (byserv
-	  (setq retval (cdr-safe (assoc path byserv)))
+	  (setq retval (cdr-safe (assoc file byserv)))
 	  (if (and (not retval)		; no exact match, check directories
-		   (string-match "/" path)) ; not looking for a realm
+		   (string-match "/" file)) ; not looking for a realm
 	      (while (and byserv (not retval))
 		(setq data (car (car byserv)))
 		(if (or (not (string-match "/" data))
 			(and
-			 (>= (length path) (length data))
-			 (string= data (substring path 0 (length data)))))
+			 (>= (length file) (length data))
+			 (string= data (substring file 0 (length data)))))
 		    (setq retval (cdr (car byserv))))
 		(setq byserv (cdr byserv))))
 	  (if (or (and (not retval) prompt) overwrite)
@@ -201,7 +201,7 @@
 					  url)))
 		      byserv (assoc server url-digest-auth-storage))
 		(setcdr byserv
-			(cons (cons path retval) (cdr byserv))))))
+			(cons (cons file retval) (cdr byserv))))))
 	 (t (setq retval nil)))
 	(if retval
 	    (let ((nonce (or (cdr-safe (assoc "nonce" args)) "nonegiven"))