From unknown Wed Aug 20 05:17:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#20929: problem with diff -B and incomplete lines Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-diffutils@gnu.org Resent-Date: Mon, 29 Jun 2015 16:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 20929 X-GNU-PR-Package: diffutils X-GNU-PR-Keywords: To: 20929@debbugs.gnu.org, ranido@ic.unicamp.br X-Debbugs-Original-To: Diffutils bugs , Ricardo Anido Received: via spool by submit@debbugs.gnu.org id=B.143559714014356 (code B ref -1); Mon, 29 Jun 2015 16:59:02 +0000 Received: (at submit) by debbugs.gnu.org; 29 Jun 2015 16:59:00 +0000 Received: from localhost ([127.0.0.1]:33253 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9cOZ-0003jR-78 for submit@debbugs.gnu.org; Mon, 29 Jun 2015 12:58:59 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58283) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9cOW-0003jD-FW for submit@debbugs.gnu.org; Mon, 29 Jun 2015 12:58:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9cOQ-0000k7-Ch for submit@debbugs.gnu.org; Mon, 29 Jun 2015 12:58:51 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:51006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9cOQ-0000jw-98 for submit@debbugs.gnu.org; Mon, 29 Jun 2015 12:58:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9cOP-0006n7-1A for bug-diffutils@gnu.org; Mon, 29 Jun 2015 12:58:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9cOL-0000hr-ND for bug-diffutils@gnu.org; Mon, 29 Jun 2015 12:58:48 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:39848) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9cOL-0000go-Hd for bug-diffutils@gnu.org; Mon, 29 Jun 2015 12:58:45 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id CE78316081B; Mon, 29 Jun 2015 09:58:43 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id xcEx5DFlK209; Mon, 29 Jun 2015 09:58:42 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id B6B57160660; Mon, 29 Jun 2015 09:58:42 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id IqQGkycK9MFH; Mon, 29 Jun 2015 09:58:42 -0700 (PDT) Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 99599160176; Mon, 29 Jun 2015 09:58:42 -0700 (PDT) Message-ID: <55917942.90403@cs.ucla.edu> Date: Mon, 29 Jun 2015 09:58:42 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 References: In-Reply-To: X-Forwarded-Message-Id: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Thanks for the bug report. I'm forwarding this to bug-diffutils so that it gets a proper bug number. -------- Forwarded Message -------- Subject: Bug in diff Date: Mon, 29 Jun 2015 16:00:48 +0100 From: Ricardo Anido To: bug-gnu-utils@gnu.org If the last line of a file has a sole character and no '\n', using the flag -B makes diff miss the difference between files. The difference is correctly reported using flags -b or -w. Better explained by an example, below. Notice that the last line of tmp2 has only the character 'X': -------------------- ranido@ubuntu:~$ cat tmp1 a b c ranido@ubuntu:~$ cat tmp2 a b c Xranido@ubuntu:~$ od -cx tmp1 0000000 a \n b \n c \n 0a61 0a62 0a63 0000006 ranido@ubuntu:~$ od -cx tmp2 0000000 a \n b \n c \n X 0a61 0a62 0a63 0058 0000007 ranido@ubuntu:~$ diff -B tmp1 tmp2 ranido@ubuntu:~$ diff -b tmp1 tmp2 3a4 > X \ No newline at end of file ranido@ubuntu:~$ -------------------- Best regards, thanks for the amazing work on gnu! --- Ricardo Anido IC-UNICAMP Av. Albert Einstein, 1251 13083-852 Campinas SP Tel. (19) 3521 5863 Fax. (19) 3521 5847 From unknown Wed Aug 20 05:17:00 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Paul Eggert Subject: bug#20929: closed (Re: problem with diff -B and incomplete lines) Message-ID: References: <55917942.90403@cs.ucla.edu> X-Gnu-PR-Message: they-closed 20929 X-Gnu-PR-Package: diffutils Reply-To: 20929@debbugs.gnu.org Date: Sun, 01 May 2016 02:12:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1462068722-8162-1" This is a multi-part message in MIME format... ------------=_1462068722-8162-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #20929: problem with diff -B and incomplete lines which was filed against the diffutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 20929@debbugs.gnu.org. --=20 20929: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D20929 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1462068722-8162-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 20929-done) by debbugs.gnu.org; 1 May 2016 02:11:42 +0000 Received: from localhost ([127.0.0.1]:58933 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awgrG-000278-4s for submit@debbugs.gnu.org; Sat, 30 Apr 2016 22:11:42 -0400 Received: from mail-ob0-f193.google.com ([209.85.214.193]:33656) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awgrE-00026w-Dc for 20929-done@debbugs.gnu.org; Sat, 30 Apr 2016 22:11:40 -0400 Received: by mail-ob0-f193.google.com with SMTP id nj8so10383546obc.0 for <20929-done@debbugs.gnu.org>; Sat, 30 Apr 2016 19:11:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:message-id:subject:to; bh=O5Ua4tJnXaKNT9ZeCNs8INX6CjJTxUfdfEmgyPOhLxk=; b=hD/yqrr/usnE5fQ8bP/+N0A746DiTUE5biBZIsrpwZ0Hk1vDRgHaRUegEpoLmUSBoB Bp6kPfoieQ/yqPF3VJ8pNQ9oihy3TaHqup1Xq93YZwJPbnxX72+7tk6I4/sd8kc2rhEe Ix3Xu4Y1BV5R8QjOvjEoy4MuATiIfor0YnLYroetX47coDngTiLO0d9K5qFJ4dc2hRyB fIwSakwWy5HtHm/oIECzAo8KrR6BCmOso9qcSZtH01MKgMousqz/06jB7eS+S9X1pi4G og+4GGZ2ih/R4gCWwWFEBs+gMotuOEYI3hd8oWtAlNGZkbGT4gIvZQFoRRd78PbqRwIo pDPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to; bh=O5Ua4tJnXaKNT9ZeCNs8INX6CjJTxUfdfEmgyPOhLxk=; b=bvCtQmqqn7NDfOhkzk2rDri38B10mCIXg4F4rS11yucQhpE79WQTe0WDdBIok1GWSH 17ASu1QYEpeMQC5QrpzL31AshiHjSWlTAEudVbNhuCsv+ovX67e0Hqp7HZXUkm0Rlu/5 vwa4onLZWQcfLGcfL3UswWD4P1u/tDs5bgWZq5LVp8kaAsojM7I6fOnLFu7GGLHqivC1 hGWWjlU+Ed+z++oh5/TrO3TcdUoxMiaCX8kdefwccF+qxVLNInPY8mW8wsWSo3jVVbbf EE61sHcA2YmtVx33TihIBIqBuz5aVZ8j02fFkiQq2gnd6/TAT/p3ouROJ0Rvw6w1n+6s nRPg== X-Gm-Message-State: AOPr4FVF8dew4FjoxnjnDYYhmBFTOyMQWO0VVj+6GpUfc8C9kY8jkvDhD9rWFV6xZeGMS9C4fUTbHWmwLNYmgQ== X-Received: by 10.182.157.37 with SMTP id wj5mr12262962obb.71.1462068694923; Sat, 30 Apr 2016 19:11:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.202.175.193 with HTTP; Sat, 30 Apr 2016 19:11:15 -0700 (PDT) From: Jim Meyering Date: Sat, 30 Apr 2016 19:11:15 -0700 X-Google-Sender-Auth: UzWlZeY33Qj9KwO1IoMOXLwnXa4 Message-ID: Subject: Re: problem with diff -B and incomplete lines To: 20929-done@debbugs.gnu.org Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 20929-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) Thanks for the report. That was fixed by this change: http://git.savannah.gnu.org/cgit/diffutils.git/commit/?id=v3.3-24-gd2fd9d4 That will be included in the upcoming diffutils-3.4 ------------=_1462068722-8162-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 29 Jun 2015 16:59:00 +0000 Received: from localhost ([127.0.0.1]:33253 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9cOZ-0003jR-78 for submit@debbugs.gnu.org; Mon, 29 Jun 2015 12:58:59 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58283) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9cOW-0003jD-FW for submit@debbugs.gnu.org; Mon, 29 Jun 2015 12:58:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9cOQ-0000k7-Ch for submit@debbugs.gnu.org; Mon, 29 Jun 2015 12:58:51 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:51006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9cOQ-0000jw-98 for submit@debbugs.gnu.org; Mon, 29 Jun 2015 12:58:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9cOP-0006n7-1A for bug-diffutils@gnu.org; Mon, 29 Jun 2015 12:58:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9cOL-0000hr-ND for bug-diffutils@gnu.org; Mon, 29 Jun 2015 12:58:48 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:39848) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9cOL-0000go-Hd for bug-diffutils@gnu.org; Mon, 29 Jun 2015 12:58:45 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id CE78316081B; Mon, 29 Jun 2015 09:58:43 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id xcEx5DFlK209; Mon, 29 Jun 2015 09:58:42 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id B6B57160660; Mon, 29 Jun 2015 09:58:42 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id IqQGkycK9MFH; Mon, 29 Jun 2015 09:58:42 -0700 (PDT) Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 99599160176; Mon, 29 Jun 2015 09:58:42 -0700 (PDT) Message-ID: <55917942.90403@cs.ucla.edu> Date: Mon, 29 Jun 2015 09:58:42 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Diffutils bugs , Ricardo Anido Subject: problem with diff -B and incomplete lines References: In-Reply-To: X-Forwarded-Message-Id: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Thanks for the bug report. I'm forwarding this to bug-diffutils so that it gets a proper bug number. -------- Forwarded Message -------- Subject: Bug in diff Date: Mon, 29 Jun 2015 16:00:48 +0100 From: Ricardo Anido To: bug-gnu-utils@gnu.org If the last line of a file has a sole character and no '\n', using the flag -B makes diff miss the difference between files. The difference is correctly reported using flags -b or -w. Better explained by an example, below. Notice that the last line of tmp2 has only the character 'X': -------------------- ranido@ubuntu:~$ cat tmp1 a b c ranido@ubuntu:~$ cat tmp2 a b c Xranido@ubuntu:~$ od -cx tmp1 0000000 a \n b \n c \n 0a61 0a62 0a63 0000006 ranido@ubuntu:~$ od -cx tmp2 0000000 a \n b \n c \n X 0a61 0a62 0a63 0058 0000007 ranido@ubuntu:~$ diff -B tmp1 tmp2 ranido@ubuntu:~$ diff -b tmp1 tmp2 3a4 > X \ No newline at end of file ranido@ubuntu:~$ -------------------- Best regards, thanks for the amazing work on gnu! --- Ricardo Anido IC-UNICAMP Av. Albert Einstein, 1251 13083-852 Campinas SP Tel. (19) 3521 5863 Fax. (19) 3521 5847 ------------=_1462068722-8162-1--