bug#79804: Comm: "--output-delimiter", when set to a zero-sized string, prints null character ('\0')

rubisetcie <[email protected]> Sun, 9 Nov 2025 13:17:06 +0100
Newsgroups gmane.comp.gnu.core-utils.bugs
Message-ID <CADDn39+Ry1R7Ude5hVXHcTE+OpB1M6pxm56EFZ+t-Fs9Gc_RNw@mail.gmail.com>
Hello dear developers/maintainers, I hope you're doing alright.

I don't know if this is a bug, a workaround or an intended behavior, but I
need `comm` to suppress the "delimiter".

When I run the following command, in which I've set the option `
--output-delimiter` to an empty string:
`comm -3 --nocheck-order --output-delimiter='' file1 file2 > file3`

The output `*file3*` contains *unwanted null characters* ('\0') where the
delimiter should've been...

As far as I see, there don't seem to be a way to completely disable writing
the delimiter, whether this is intentional or not...

The culprit seems to be these two lines:
https://github.com/coreutils/coreutils/blob/master/src/comm.c#L485
Why setting `col_sep_len` to 1 even when `col_sep` is empty?

If this is a bug, I volunteer to fix it. :)

Thank you in advance,
Matthieu Carteron