#775·jc

cksum/sum parser raises IndexError on stdin output (no filename)

Author: Atishyy27Created Sep 24, 2026Updated Sep 24, 2026
Labelsbug

cksum and sum print only checksum blocks with no filename when reading from stdin or a pipe. The cksum parser indexes line.split(maxsplit=2)[2] unconditionally, so that two-field line raises IndexError instead of parsing.

$ printf 'hi\n' | jc cksum
$ printf 'hi\n' | jc sum

Both raise IndexError. The file-argument form (cksum somefile) has three fields and works fine. The wc parser already guards the no-filename-from-stdin case; cksum does not.