summaryrefslogtreecommitdiff
path: root/lisp/url/url-parse.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2007-04-15 16:47:20 +0000
committerChong Yidong <cyd@stupidchicken.com>2007-04-15 16:47:20 +0000
commit0539db756c2b81a78a5b16cf840ad58dbae34415 (patch)
treeef5c14e97079602f672f29f1120e8b1845f0b94c /lisp/url/url-parse.el
parent5cfdb0fb636056e39dea4eeff6c4878a91c4bd0d (diff)
downloademacs-0539db756c2b81a78a5b16cf840ad58dbae34415.tar.gz
(url-generic-parse-url): Revert 2006-10-09 changes.
Diffstat (limited to 'lisp/url/url-parse.el')
-rw-r--r--lisp/url/url-parse.el36
1 files changed, 20 insertions, 16 deletions
diff --git a/lisp/url/url-parse.el b/lisp/url/url-parse.el
index 2b69c54133f..a9a0fb151e9 100644
--- a/lisp/url/url-parse.el
+++ b/lisp/url/url-parse.el
@@ -108,7 +108,7 @@
(defun url-recreate-url-attributes (urlobj)
"Recreate the attributes of an URL string from the parsed URLOBJ."
(when (url-attributes urlobj)
- (concat "?"
+ (concat ";"
(mapconcat (lambda (x)
(if (cdr x)
(concat (car x) "=" (cdr x))
@@ -168,7 +168,7 @@ Format is:
(setq full t)
(forward-char 2)
(setq save-pos (point))
- (skip-chars-forward "^/\\?#")
+ (skip-chars-forward "^/")
(setq host (buffer-substring save-pos (point)))
(if (string-match "^\\([^@]+\\)@" host)
(setq user (match-string 1 host)
@@ -189,25 +189,29 @@ Format is:
(setq port (url-scheme-get-property prot 'default-port)))
;; 3.3. Path
+ ;; Gross hack to preserve ';' in data URLs
(setq save-pos (point))
- (skip-chars-forward "^#?")
- (setq file (buffer-substring save-pos (point)))
;; 3.4. Query
- (when (looking-at "\\?")
- (forward-char 1)
- (setq save-pos (point))
+ (if (string= "data" prot)
+ (goto-char (point-max))
+ ;; Now check for references
(skip-chars-forward "^#")
- ;; RFC 3986 specifies no general way of parsing the query
- ;; string, but `url-parse-args' seems universal enough.
- (setq attr (url-parse-args (buffer-substring save-pos (point)) t)
- attr (nreverse attr)))
-
- ;; 3.5. Fragment
- (when (looking-at "#")
- (forward-char 1)
- (setq refs (buffer-substring (point) (point-max))))
+ (if (eobp)
+ nil
+ (delete-region
+ (point)
+ (progn
+ (skip-chars-forward "#")
+ (setq refs (buffer-substring (point) (point-max)))
+ (point-max))))
+ (goto-char save-pos)
+ (skip-chars-forward "^;")
+ (if (not (eobp))
+ (setq attr (url-parse-args (buffer-substring (point) (point-max)) t)
+ attr (nreverse attr))))
+ (setq file (buffer-substring save-pos (point)))
(if (and host (string-match "%[0-9][0-9]" host))
(setq host (url-unhex-string host)))
(vector prot user pass host port file refs attr full))))))