Package: wdiff
Version: 1.2.2-6
Severity: normal

wdiff is broken when the input contains a null character.
For instance, create 2 files a and b with

  printf "a\n2\n3\n4\n5\n6\n7\n8\n" > a
  printf "b\n2\n3\n4\n5\n6\n7\n8\n\000\n" > b

$ wdiff a b
b
2
3
4
5
6
7
8

instead of something like

[-a-]{+b+}
2
3
4
5
6
7
8
{+^@+}

Similarly, the following is incorrect:

$ diff -au a b | wdiff -d
++ b    2024-02-09 14:11:23.981863795 +0100
@@ -1,4 +1,4 @@
b
2
3
4
@@ -6,3 +6,4 @@
6
7
8

There is no such issue if I replace \000 by \001.
So this is specific to the null character.

-- System Information:
Debian Release: trixie/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'stable-updates'), (500, 
'stable-security'), (500, 'stable-debug'), (500, 'proposed-updates-debug'), 
(500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.6.13-amd64 (SMP w/12 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages wdiff depends on:
ii  libc6      2.37-15
ii  libtinfo6  6.4+20240113-1

wdiff recommends no packages.

Versions of packages wdiff suggests:
ii  wdiff-doc  1.2.2-6

-- no debconf information

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Reply via email to