coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

comm: fix comparison when reading from pipes

Open martinkunkel2 opened this issue 3 weeks ago • 4 comments

Use case is that two files are piped into comm, i.e. in bash

   comm <(cat file1) <(cat file2)

see also full example in #9537

Before the fix, comm reads from the pipes twice. Once in "fn comm" and once in "fn are_files_identical". As such, part of the data is skipped in comparison which leads to wrong output.

This is fixed by skipping the file comparison in case one of the files is not a regular file.

This fixes #9537

martinkunkel2 avatar Dec 02 '25 22:12 martinkunkel2

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

github-actions[bot] avatar Dec 02 '25 22:12 github-actions[bot]

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

github-actions[bot] avatar Dec 03 '25 19:12 github-actions[bot]

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

github-actions[bot] avatar Dec 04 '25 19:12 github-actions[bot]

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

github-actions[bot] avatar Dec 04 '25 20:12 github-actions[bot]