Skip to content

[gap] join: -z NUL-delimited output bytes differ from GNU #1008

Closed

Description

@caomengxuan666

Summary

With -z/--zero-terminated, GNU join treats NUL as the line delimiter (so an LF-containing file is one record) and emits output that differs byte-for-byte from WinuxCmd.

Repro

printf 'a\t1\nb\t2\nc\t3\n' > js1.txt
printf 'a\tx\nb\ty\nd\tz\n' > js2.txt
join -z js1.txt js2.txt | xxd

GNU coreutils 8.32

61 20 31 20 62 20 32 20 63 20 33 20 20 78 20 62   a 1 b 2 c 3  x b
20 79 20 64 20 7a 20 00                            y d z .

i.e. a 1 b 2 c 3 x b y d z \0 (note double space before x and trailing space before NUL).

WinuxCmd 1.0.6

61 20 31 20 62 20 32 20 63 20 33 20 78 20 62 20   a 1 b 2 c 3 x b
79 20 64 20 7a 00                                  y d z.

i.e. a 1 b 2 c 3 x b y d z\0 — different spacing around the second file's field payload and no trailing separator.

Activity

  1. added
    bug
    compat-gap
    on Sep 14, 2026
  2. caomengxuan666 commented on Sep 14, 2026

    @caomengxuan666
    MemberAuthor

    Fixed in release/v1.0.6 — verified against GNU coreutils 9.4 (WSL) with byte-identical or semantically identical output. See the GNU-parity commits on this branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcompat-gap

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions