t ;; Instruct caller to signal an error. Bug#50511
;; Find strongest supported auth.
(dolist (this-auth auths)
- (setq this-auth (url-eat-trailing-space
- (url-strip-leading-spaces
- this-auth)))
+ (setq this-auth (string-trim this-auth))
(let* ((this-type
(downcase (if (string-match "[ \t]" this-auth)
(substring this-auth 0 (match-beginning 0))
;;;###autoload
(defun url-eat-trailing-space (x)
"Remove spaces/tabs at the end of a string."
- (let ((y (1- (length x)))
- (skip-chars (list ? ?\t ?\n)))
- (while (and (>= y 0) (memq (aref x y) skip-chars))
- (setq y (1- y)))
- (substring x 0 (1+ y))))
+ (declare (obsolete string-trim "29.1"))
+ (string-trim x ""))
;;;###autoload
(defun url-strip-leading-spaces (x)
"Remove spaces at the front of a string."
- (let ((y (1- (length x)))
- (z 0)
- (skip-chars (list ? ?\t ?\n)))
- (while (and (<= z y) (memq (aref x z) skip-chars))
- (setq z (1+ z)))
- (substring x z nil)))
+ (declare (obsolete string-trim "29.1"))
+ (string-trim x nil ""))
(define-obsolete-function-alias 'url-pretty-length