summaryrefslogtreecommitdiff
path: root/lisp/mail/uudecode.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2020-11-07 09:57:56 -0800
committerGlenn Morris <rgm@gnu.org>2020-11-07 09:57:56 -0800
commit33e8116fc2c24b14d30c08a09cc034bea6f9d584 (patch)
tree1be8512dcde3fbf6679f931295eabbe4bb6e1b0d /lisp/mail/uudecode.el
parent1de00441a5cd983ae4d76eecd80286928e791e96 (diff)
parentf5d7fb3a2dee3f9ae49151e3d01483aad7fb734b (diff)
downloademacs-33e8116fc2c24b14d30c08a09cc034bea6f9d584.tar.gz
Merge from origin/emacs-27
f5d7fb3a2d (origin/emacs-27) Fix 'uudecode-decode-region-internal' in... d4242177da Fix 'send-string-to-terminal' writing very long strings 9da0f4026c * lisp/subr.el (read-char-from-minibuffer): Doc fix. (Bug... 9899f74e4e Merge branch 'emacs-27' of git.savannah.gnu.org:/srv/git/e... a6fcba783e Fix documentation of 'windmove-swap-states-default-keybind... f4acd7a924 Split windows evenly when 'min-margins' parameter was set ...
Diffstat (limited to 'lisp/mail/uudecode.el')
-rw-r--r--lisp/mail/uudecode.el36
1 files changed, 17 insertions, 19 deletions
diff --git a/lisp/mail/uudecode.el b/lisp/mail/uudecode.el
index bcbd571b539..0dce9b7b726 100644
--- a/lisp/mail/uudecode.el
+++ b/lisp/mail/uudecode.el
@@ -149,12 +149,10 @@ If FILE-NAME is non-nil, save the result to FILE-NAME."
(setq counter (1+ counter)
inputpos (1+ inputpos))
(cond ((= counter 4)
- (setq result (cons
- (concat
- (char-to-string (ash bits -16))
- (char-to-string (logand (ash bits -8) 255))
- (char-to-string (logand bits 255)))
- result))
+ (setq result (cons (logand bits 255)
+ (cons (logand (ash bits -8) 255)
+ (cons (ash bits -16)
+ result))))
(setq bits 0 counter 0))
(t (setq bits (ash bits 6)))))))
(cond
@@ -166,26 +164,26 @@ If FILE-NAME is non-nil, save the result to FILE-NAME."
;;(error "uucode ends unexpectedly")
(setq done t))
((= counter 3)
- (setq result (cons
- (concat
- (char-to-string (logand (ash bits -16) 255))
- (char-to-string (logand (ash bits -8) 255)))
- result)))
+ (setq result (cons (logand (ash bits -8) 255)
+ (cons (logand (ash bits -16) 255)
+ result))))
((= counter 2)
- (setq result (cons
- (char-to-string (logand (ash bits -10) 255))
- result))))
+ (setq result (cons (logand (ash bits -10) 255)
+ result))))
(skip-chars-forward non-data-chars end))
(if file-name
(with-temp-file file-name
(set-buffer-multibyte nil)
- (insert (apply #'concat (nreverse result))))
+ (apply #'insert (nreverse result)))
(or (markerp end) (setq end (set-marker (make-marker) end)))
(goto-char start)
- (if enable-multibyte-characters
- (dolist (x (nreverse result))
- (insert (decode-coding-string x 'binary)))
- (insert (apply #'concat (nreverse result))))
+ (apply #'insert
+ (nreverse
+ (if enable-multibyte-characters
+ (mapcar (lambda (ch)
+ (or (decode-char 'eight-bit ch) ch))
+ result)
+ result)))
(delete-region (point) end))))))
;;;###autoload