annotate lisp/w3/url-parse.el @ 86:364816949b59 r20-0b93

Import from CVS: tag r20-0b93
author cvs
date Mon, 13 Aug 2007 09:09:02 +0200
parents 6a378aca36af
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
1 ;;; url-parse.el --- Uniform Resource Locator parser
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
2 ;; Author: wmperry
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
3 ;; Created: 1997/01/23 16:48:58
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
4 ;; Version: 1.6
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
5 ;; Keywords: comm, data, processes
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
6
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
8 ;;; Copyright (c) 1993-1996 by William M. Perry (wmperry@cs.indiana.edu)
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 14
diff changeset
9 ;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
10 ;;;
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
11 ;;; This file is not part of GNU Emacs, but the same permissions apply.
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
12 ;;;
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
13 ;;; GNU Emacs is free software; you can redistribute it and/or modify
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
14 ;;; it under the terms of the GNU General Public License as published by
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
15 ;;; the Free Software Foundation; either version 2, or (at your option)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
16 ;;; any later version.
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
17 ;;;
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
18 ;;; GNU Emacs is distributed in the hope that it will be useful,
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
19 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
21 ;;; GNU General Public License for more details.
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
22 ;;;
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
23 ;;; You should have received a copy of the GNU General Public License
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
24 ;;; along with GNU Emacs; see the file COPYING. If not, write to the
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
25 ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
26 ;;; Boston, MA 02111-1307, USA.
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
28 (defmacro url-type (urlobj)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
29 (` (aref (, urlobj) 0)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
30
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
31 (defmacro url-user (urlobj)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
32 (` (aref (, urlobj) 1)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
33
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
34 (defmacro url-password (urlobj)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
35 (` (aref (, urlobj) 2)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
36
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
37 (defmacro url-host (urlobj)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
38 (` (aref (, urlobj) 3)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
39
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
40 (defmacro url-port (urlobj)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
41 (` (or (aref (, urlobj) 4)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
42 (if (url-fullness (, urlobj))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
43 (cdr-safe (assoc (url-type (, urlobj)) url-default-ports))))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
44
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
45 (defmacro url-filename (urlobj)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
46 (` (aref (, urlobj) 5)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
47
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
48 (defmacro url-target (urlobj)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
49 (` (aref (, urlobj) 6)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
50
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
51 (defmacro url-attributes (urlobj)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
52 (` (aref (, urlobj) 7)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
53
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
54 (defmacro url-fullness (urlobj)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
55 (` (aref (, urlobj) 8)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
56
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
57 (defmacro url-set-type (urlobj type)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
58 (` (aset (, urlobj) 0 (, type))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
59
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
60 (defmacro url-set-user (urlobj user)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
61 (` (aset (, urlobj) 1 (, user))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
62
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
63 (defmacro url-set-password (urlobj pass)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
64 (` (aset (, urlobj) 2 (, pass))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
65
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
66 (defmacro url-set-host (urlobj host)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
67 (` (aset (, urlobj) 3 (, host))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
68
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
69 (defmacro url-set-port (urlobj port)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
70 (` (aset (, urlobj) 4 (, port))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
71
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
72 (defmacro url-set-filename (urlobj file)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
73 (` (aset (, urlobj) 5 (, file))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
74
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
75 (defmacro url-set-target (urlobj targ)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
76 (` (aset (, urlobj) 6 (, targ))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
77
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
78 (defmacro url-set-attributes (urlobj targ)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
79 (` (aset (, urlobj) 7 (, targ))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
80
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
81 (defmacro url-set-full (urlobj val)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
82 (` (aset (, urlobj) 8 (, val))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
83
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
84 (defun url-recreate-url (urlobj)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
85 (concat (url-type urlobj) ":" (if (url-host urlobj) "//" "")
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
86 (if (url-user urlobj)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
87 (concat (url-user urlobj)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
88 (if (url-password urlobj)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
89 (concat ":" (url-password urlobj)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
90 "@"))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
91 (url-host urlobj)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
92 (if (and (url-port urlobj)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
93 (not (equal (url-port urlobj)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
94 (cdr-safe (assoc (url-type urlobj)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
95 url-default-ports)))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
96 (concat ":" (url-port urlobj)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
97 (or (url-filename urlobj) "/")
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
98 (if (url-target urlobj)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
99 (concat "#" (url-target urlobj)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
100 (if (url-attributes urlobj)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
101 (concat ";"
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
102 (mapconcat
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
103 (function
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
104 (lambda (x)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
105 (if (cdr x)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
106 (concat (car x) "=" (cdr x))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
107 (car x)))) (url-attributes urlobj) ";")))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
108
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
109 (defun url-generic-parse-url (url)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
110 "Return a vector of the parts of URL.
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
111 Format is:
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
112 [proto username password hostname portnumber file reference attributes fullp]"
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
113 (cond
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
114 ((null url)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
115 (make-vector 9 nil))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
116 ((or (not (string-match url-nonrelative-link url))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
117 (= ?/ (string-to-char url)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
118 (let ((retval (make-vector 9 nil)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
119 (url-set-filename retval url)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
120 (url-set-full retval nil)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
121 retval))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
122 (t
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
123 (save-excursion
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
124 (set-buffer (get-buffer-create " *urlparse*"))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
125 (set-syntax-table url-mailserver-syntax-table)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
126 (let ((save-pos nil)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
127 (prot nil)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
128 (user nil)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
129 (pass nil)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
130 (host nil)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
131 (port nil)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
132 (file nil)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
133 (refs nil)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
134 (attr nil)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
135 (full nil)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
136 (inhibit-read-only t))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
137 (erase-buffer)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
138 (insert url)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
139 (goto-char (point-min))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
140 (setq save-pos (point))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
141 (if (not (looking-at "//"))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
142 (progn
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
143 (skip-chars-forward "a-zA-Z+.\\-")
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
144 (downcase-region save-pos (point))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
145 (setq prot (buffer-substring save-pos (point)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
146 (skip-chars-forward ":")
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
147 (setq save-pos (point))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
148
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
149 ;; We are doing a fully specified URL, with hostname and all
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
150 (if (looking-at "//")
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
151 (progn
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
152 (setq full t)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
153 (forward-char 2)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
154 (setq save-pos (point))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
155 (skip-chars-forward "^/")
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
156 (setq host (buffer-substring save-pos (point)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
157 (if (string-match "^\\([^@]+\\)@" host)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
158 (setq user (url-match host 1)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
159 host (substring host (match-end 0) nil)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
160 (if (and user (string-match "\\([^:]+\\):\\(.*\\)" user))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
161 (setq pass (url-match user 2)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
162 user (url-match user 1)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
163 (if (string-match ":\\([0-9+]+\\)" host)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
164 (setq port (url-match host 1)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
165 host (substring host 0 (match-beginning 0))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
166 (if (string-match ":$" host)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
167 (setq host (substring host 0 (match-beginning 0))))
86
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
168 (setq host (downcase host)
364816949b59 Import from CVS: tag r20-0b93
cvs
parents: 82
diff changeset
169 save-pos (point))))
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
170 ;; Now check for references
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
171 (setq save-pos (point))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
172 (skip-chars-forward "^#")
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
173 (if (eobp)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
174 nil
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
175 (delete-region
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
176 (point)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
177 (progn
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
178 (skip-chars-forward "#")
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
179 (setq refs (buffer-substring (point) (point-max)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
180 (point-max))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
181 (goto-char save-pos)
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
182 (skip-chars-forward "^;")
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
183 (if (not (eobp))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
184 (setq attr (mm-parse-args (point) (point-max))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
185 attr (nreverse attr)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
186 (setq file (buffer-substring save-pos (point)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
187 (and port (string= port (or (cdr-safe (assoc prot url-default-ports))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
188 ""))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
189 (setq port nil))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
190 (if (and host (string-match "%[0-9][0-9]" host))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
191 (setq host (url-unhex-string host)))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
192 (vector prot user pass host port file refs attr full))))))
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
193
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents:
diff changeset
194 (provide 'url-parse)