colortail icon indicating copy to clipboard operation
colortail copied to clipboard

Colortail emits an extra NULL after each EOL

Open phord opened this issue 14 years ago • 2 comments

Colortail is writing null bytes after each EOL character. This shows up when I pipe into less or hexdump.

echo test > foo
echo another test >> foo
colortail foo | hexdump -C
00000000  3d 3d 3e 20 66 6f 6f 20  3c 3d 3d 0a 74 65 73 74  |==> foo <==.test|
00000010  0a 00 61 6e 6f 74 68 65  72 20 74 65 73 74 0a 00  |..another test..|

phord avatar May 26 '11 23:05 phord

Note: This also causes 'grep' to consider the emitted stream to be binary.

phord avatar May 26 '11 23:05 phord

this happens because "ends" (a null char) is added to the end of each line after the \n or endl

DrOwl avatar Jun 04 '14 11:06 DrOwl