Function: url-path-and-query

url-path-and-query is a byte-compiled function defined in url-parse.el.gz.

Signature

(url-path-and-query URLOBJ)

Documentation

Return the path and query components of URLOBJ.

These two components are stored together in the FILENAME slot of the object. The return value of this function is (PATH . QUERY), where each of PATH and QUERY are strings or nil.

Source Code

;; Defined in /usr/src/emacs/lisp/url/url-parse.el.gz
(defun url-path-and-query (urlobj)
  "Return the path and query components of URLOBJ.
These two components are stored together in the FILENAME slot of
the object.  The return value of this function is (PATH . QUERY),
where each of PATH and QUERY are strings or nil."
  (let ((name (url-filename urlobj))
	path query)
    (when name
      (if (string-match "\\?" name)
	  (setq path  (substring name 0 (match-beginning 0))
		query (substring name (match-end 0)))
	(setq path name)))
    (cons path query)))