From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Toru TSUNEYOSHI Newsgroups: gmane.emacs.bugs Subject: bug#5251: 23.1; problem in decode_eol of coding.c Date: Sun, 20 Dec 2009 17:57:09 +0900 Message-ID: Reply-To: Toru TSUNEYOSHI , 5251@debbugs.gnu.org NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Sun_Dec_20_17_57_09_2009_140)--" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1261339841 14605 80.91.229.12 (20 Dec 2009 20:10:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 20 Dec 2009 20:10:41 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 20 21:10:34 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NMS6r-0006du-EC for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Dec 2009 21:10:33 +0100 Original-Received: from localhost ([127.0.0.1]:55230 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NMS6r-00019V-Gc for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Dec 2009 15:10:33 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NMS6b-00014t-8p for bug-gnu-emacs@gnu.org; Sun, 20 Dec 2009 15:10:17 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NMS6W-00014F-Lf for bug-gnu-emacs@gnu.org; Sun, 20 Dec 2009 15:10:16 -0500 Original-Received: from [199.232.76.173] (port=42385 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NMS6W-00014C-Gm for bug-gnu-emacs@gnu.org; Sun, 20 Dec 2009 15:10:12 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59303) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NMS6W-0001em-44 for bug-gnu-emacs@gnu.org; Sun, 20 Dec 2009 15:10:12 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NMRfG-000878-2X; Sun, 20 Dec 2009 14:42:02 -0500 X-Loop: bug-gnu-emacs@gnu.org Mail-Followup-To: Toru TSUNEYOSHI , 5251@debbugs.gnu.org Resent-From: Toru TSUNEYOSHI Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Dec 2009 19:42:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: report 5251 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@debbugs.gnu.org id=B.126133809531168 (code B ref -1); Sun, 20 Dec 2009 19:42:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Dec 2009 19:41:35 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NMRep-00086e-1s for submit@debbugs.gnu.org; Sun, 20 Dec 2009 14:41:35 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NMHbb-00038G-KN for submit@debbugs.gnu.org; Sun, 20 Dec 2009 03:57:36 -0500 Original-Received: from mx10.gnu.org ([199.232.76.166]:58063) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NMHbY-0000vU-MR for submit@debbugs.gnu.org; Sun, 20 Dec 2009 03:57:32 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NMHbX-0005i2-Fr for submit@debbugs.gnu.org; Sun, 20 Dec 2009 03:57:32 -0500 Original-Received: from lists.gnu.org ([199.232.76.165]:49329) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NMHbX-0005hy-B2 for submit@debbugs.gnu.org; Sun, 20 Dec 2009 03:57:31 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NMHbX-0004wA-36 for bug-gnu-emacs@gnu.org; Sun, 20 Dec 2009 03:57:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NMHbP-0004uO-6I for bug-gnu-emacs@gnu.org; Sun, 20 Dec 2009 03:57:27 -0500 Original-Received: from [199.232.76.173] (port=39386 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NMHbO-0004uC-T4 for bug-gnu-emacs@gnu.org; Sun, 20 Dec 2009 03:57:23 -0500 Original-Received: from blu0-omc1-s28.blu0.hotmail.com ([65.55.116.39]:28262) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NMHbO-0005hN-L8 for bug-gnu-emacs@gnu.org; Sun, 20 Dec 2009 03:57:22 -0500 Original-Received: from BLU0-SMTP70 ([65.55.116.8]) by blu0-omc1-s28.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Sun, 20 Dec 2009 00:57:21 -0800 X-Originating-IP: [124.155.30.210] X-Originating-Email: [t_tuneyosi@hotmail.com] Original-Received: from localhost ([124.155.30.210]) by BLU0-SMTP70.blu0.hotmail.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Sun, 20 Dec 2009 00:57:20 -0800 X-Mailer: Mew version 6.3 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) X-OriginalArrivalTime: 20 Dec 2009 08:57:20.0708 (UTC) FILETIME=[706EA040:01CA8152] X-detected-operating-system: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Mailman-Approved-At: Sun, 20 Dec 2009 14:41:34 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 20 Dec 2009 14:42:02 -0500 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:33698 Archived-At: ----Next_Part(Sun_Dec_20_17_57_09_2009_140)-- Content-Type: Text/Plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit In GNU Emacs 23.1, there is a problem in decode_eol of coding.c. In buffer of which enable-multibyte-characters is nil, the function `decode-coding-region' should delete the character '^M' (code: 0x0d) at the end of line, in case that the function parameter `coding-system' is *-dos (and the variable `inhibit-eol-conversion' is nil). But, in practice, the function doesn't delete all of the character '^M'. You can watch the problem with the following. ======================================================================== (progn (pop-to-buffer (generate-new-buffer-name "*scratch*")) (set-buffer-multibyte nil) (insert (encode-coding-string "あ" 'euc-jp) "\xd" "\n") (read-char "(press any key)") (decode-coding-region (point-min) (point-max) 'euc-jp-dos) (read-char "doesn't delete all of the character '^M'. (press any key)") (set-buffer-multibyte t)) ======================================================================== I made a patch to fix the problem. Please check it. ----Next_Part(Sun_Dec_20_17_57_09_2009_140)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="coding.c__decode_eol.diff" --- coding.c.orig 2009-07-08 12:09:16.000000000 +0900 +++ coding.c 2009-12-20 16:36:45.887121600 +0900 @@ -6598,7 +6598,8 @@ { int pos_byte = coding->dst_pos_byte; int pos = coding->dst_pos; - int pos_end = pos + coding->produced_char - 1; + int pos_end = pos + (coding->dst_multibyte + ? coding->produced_char : coding->produced) - 1; while (pos < pos_end) { ----Next_Part(Sun_Dec_20_17_57_09_2009_140)----