Subject: bug#1809: decode-coding-inserted-region corrupts files

From: "Juanma Barranquero" <[email-masked]>
Date: Thu, 15 Jan 2009 03:40:22 +0100

On Thu, Jan 15, 2009 at 02:12, Juri Linkov <[email-masked]> wrote:

> (progn
>  (switch-to-buffer "test")
>  (insert "Test.\nTest2.\nTest3.\n")
>  (decode-coding-inserted-region
>   (point-min) (point-max) "/tmp/test" t nil nil nil))

(with-temp-buffer
   (insert (make-string 20 ?.))
   (decode-coding-region 1 (point-max) 'raw-text)
   (buffer-string))

 => "^@..................."

It only happens for a string of length 20 bytes.

    Juanma