[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tramp (2.0.38); internal uuencode can leave trailing NULs
From: |
Michael Albinus |
Subject: |
Re: tramp (2.0.38); internal uuencode can leave trailing NULs |
Date: |
Sun, 16 May 2004 23:13:37 +0200 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) |
Aaron Ucko <address@hidden> writes:
> TRAMP's internal uuencode implementation, which seems to be its
> default encoding method (at least on this system, which doesn't have
> mimencode, mmencode, or recode installed), has an annoying bug: if
> the content's length is just short of a multiple of 45 bytes, the
> last line of data starts with M rather than K or L, so the padding
> turns into one or two actual NULs.
Fixed in Tramp CVS. You can try the following patch:
--- tramp-uu.el.~2.4.~ 2003-12-01 21:54:58.000000000 +0100
+++ tramp-uu.el 2004-05-16 22:56:49.000000000 +0200
@@ -63,10 +63,10 @@
(setq c (char-after (point)))
(delete-char 1)
(if (equal c ?=)
- ;; "=" means padding. Insert "`" instead.
- (insert "`")
- (insert (tramp-uu-byte-to-uu-char (tramp-uu-b64-char-to-byte c))))
- (setq i (1+ i))
+ ;; "=" means padding. Insert "`" instead. Not counted for length.
+ (progn (insert "`") (setq len (1- len)))
+ (insert (tramp-uu-byte-to-uu-char (tramp-uu-b64-char-to-byte c)))
+ (setq i (1+ i)))
;; Every 60 characters, add "M" at beginning of line (as
;; length byte) and insert a newline.
(when (zerop (% i 60))
Thanx for reporting the bug. Best regards, Michael.