GNU bug report logs - #64461
strange output of "diff -l -y"

Previous Next

Package: diffutils;

Reported by: Bruno Haible <bruno <at> clisp.org>

Date: Tue, 4 Jul 2023 16:48:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Bruno Haible <bruno <at> clisp.org>
To: bug-diffutils <at> gnu.org
Subject: strange output of "diff -l -y"
Date: Tue, 04 Jul 2023 18:47:04 +0200
[Message part 1 (text/plain, inline)]
Hi,

Seen with diffutils 'master' branch today:

$ cat foo1.txt
你好
$ cat foo2.txt
早晨, 你好
$ src/diff -y foo1.txt foo2.txt
你好                                                          | 早晨, 你好
$ src/diff -l -y foo1.txt foo2.txt


2023-07-04 18:41           diff -l -y foo1.txt foo2.txt           Page 1


                                                              | , 




























































你好早晨你好

(and the last line is not terminated by a newline).

This is strange, isn't it? 'diff' has separate the ASCII from the
non-ASCII parts of the input. With the attached patch, the output becomes:

$ src/diff -l -y foo1.txt foo2.txt


2023-07-04 18:42           diff -l -y foo1.txt foo2.txt           Page 1


你好                                                          | 早晨, 你好





























































(which is more what I had expected).

[0001-diff-Fix-output-of-diff-l-y-for-non-ASCII-input-file.patch (text/x-patch, attachment)]

This bug report was last modified 2 years and 38 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.