+2005-05-06 Juanma Barranquero <lekktu@gmail.com>
+
+ * url-auth.el (url-register-auth-scheme):
+ * url-cookie.el (url-cookie-expired-p):
+ * url-dav.el (url-dav-process-date-property)
+ (url-dav-process-boolean-property, url-dav-process-DAV:status):
+ * url-http.el (url-http-chunked-encoding-after-change-function)
+ (url-http-wait-for-headers-change-function):
+ * url-ns.el (isInNet):
+ * url-parse.el (url-generic-parse-url):
+ * url-util.el (url-get-normalized-date): Replace `string-to-int'
+ by `string-to-number'.
+
2005-04-18 Stefan Monnier <monnier@iro.umontreal.ca>
* url.el (url-retrieve-synchronously): Work around the fact that
(function (or function (intern (concat "url-" type "-auth"))))
(rating (cond
((null rating) 2)
- ((stringp rating) (string-to-int rating))
+ ((stringp rating) (string-to-number rating))
(t rating)))
(node (assoc type url-registered-auth-schemes)))
(if (not (fboundp function))
(cur-date (and exp (timezone-parse-date (current-time-string))))
(exp-date (and exp (timezone-parse-date exp)))
(cur-greg (and cur-date (timezone-absolute-from-gregorian
- (string-to-int (aref cur-date 1))
- (string-to-int (aref cur-date 2))
- (string-to-int (aref cur-date 0)))))
+ (string-to-number (aref cur-date 1))
+ (string-to-number (aref cur-date 2))
+ (string-to-number (aref cur-date 0)))))
(exp-greg (and exp (timezone-absolute-from-gregorian
- (string-to-int (aref exp-date 1))
- (string-to-int (aref exp-date 2))
- (string-to-int (aref exp-date 0)))))
+ (string-to-number (aref exp-date 1))
+ (string-to-number (aref exp-date 2))
+ (string-to-number (aref exp-date 0)))))
(diff-in-days (and exp (- cur-greg exp-greg)))
)
(cond
(t ; Expires sometime today, check times
(let* ((cur-time (timezone-parse-time (aref cur-date 3)))
(exp-time (timezone-parse-time (aref exp-date 3)))
- (cur-norm (+ (* 360 (string-to-int (aref cur-time 2)))
- (* 60 (string-to-int (aref cur-time 1)))
- (* 1 (string-to-int (aref cur-time 0)))))
- (exp-norm (+ (* 360 (string-to-int (aref exp-time 2)))
- (* 60 (string-to-int (aref exp-time 1)))
- (* 1 (string-to-int (aref exp-time 0))))))
+ (cur-norm (+ (* 360 (string-to-number (aref cur-time 2)))
+ (* 60 (string-to-number (aref cur-time 1)))
+ (* 1 (string-to-number (aref cur-time 0)))))
+ (exp-norm (+ (* 360 (string-to-number (aref exp-time 2)))
+ (* 60 (string-to-number (aref exp-time 1)))
+ (* 1 (string-to-number (aref exp-time 0))))))
(> (- cur-norm exp-norm) 1))))))
;;;###autoload
;; Nobody else handles iso8601 correctly, lets do it ourselves.
(when (string-match date-re date-string re-start)
- (setq year (string-to-int (match-string 1 date-string))
- month (string-to-int (match-string 2 date-string))
- day (string-to-int (match-string 3 date-string))
+ (setq year (string-to-number (match-string 1 date-string))
+ month (string-to-number (match-string 2 date-string))
+ day (string-to-number (match-string 3 date-string))
re-start (match-end 0))
(when (string-match time-re date-string re-start)
- (setq hour (string-to-int (match-string 1 date-string))
- minute (string-to-int (match-string 2 date-string))
- seconds (string-to-int (match-string 3 date-string))
- fractional-seconds (string-to-int (or
- (match-string 4 date-string)
- "0"))
+ (setq hour (string-to-number (match-string 1 date-string))
+ minute (string-to-number (match-string 2 date-string))
+ seconds (string-to-number (match-string 3 date-string))
+ fractional-seconds (string-to-number (or
+ (match-string 4 date-string)
+ "0"))
re-start (match-end 0))
(when (string-match tz-re date-string re-start)
(setq tz (match-string 1 date-string)))
time))
(defun url-dav-process-boolean-property (node)
- (/= 0 (string-to-int (url-dav-node-text node))))
+ (/= 0 (string-to-number (url-dav-node-text node))))
(defun url-dav-process-uri-property (node)
;; Returns a parsed representation of the URL...
;; only care about the numeric status code.
(let ((status (url-dav-node-text node)))
(if (string-match "\\`[ \r\t\n]*HTTP/[0-9.]+ \\([0-9]+\\)" status)
- (string-to-int (match-string 1 status))
+ (string-to-number (match-string 1 status))
500)))
(defun url-dav-process-DAV:propstat (node)
'text-cursor
'cursor)
'invisible t))
- (setq url-http-chunked-length (string-to-int (buffer-substring
- (match-beginning 1)
- (match-end 1))
- 16)
+ (setq url-http-chunked-length (string-to-number (buffer-substring
+ (match-beginning 1)
+ (match-end 1))
+ 16)
url-http-chunked-counter (1+ url-http-chunked-counter)
url-http-chunked-start (set-marker
(or url-http-chunked-start
url-http-content-type (mail-fetch-field "content-type"))
(if (mail-fetch-field "content-length")
(setq url-http-content-length
- (string-to-int (mail-fetch-field "content-length"))))
+ (string-to-number (mail-fetch-field "content-length"))))
(widen)))
(if url-http-transfer-encoding
(setq url-http-transfer-encoding
(if (or (/= (length netc) (length ipc))
(/= (length ipc) (length maskc)))
nil
- (setq netc (mapcar 'string-to-int netc)
- ipc (mapcar 'string-to-int ipc)
- maskc (mapcar 'string-to-int maskc))
+ (setq netc (mapcar 'string-to-number netc)
+ ipc (mapcar 'string-to-number ipc)
+ maskc (mapcar 'string-to-number maskc))
(and
(= (logand (nth 0 netc) (nth 0 maskc))
(logand (nth 0 ipc) (nth 0 maskc)))
(setq pass (match-string 2 user)
user (match-string 1 user)))
(if (string-match ":\\([0-9+]+\\)" host)
- (setq port (string-to-int (match-string 1 host))
+ (setq port (string-to-number (match-string 1 host))
host (substring host 0 (match-beginning 0))))
(if (string-match ":$" host)
(setq host (substring host 0 (match-beginning 0))))
(year nil)
(month (car
(rassoc
- (string-to-int (aref parsed 1)) url-monthabbrev-alist)))
+ (string-to-number (aref parsed 1)) url-monthabbrev-alist)))
)
(setq day (or (car-safe (rassoc day url-weekday-alist))
(substring raw 0 3))