joakim666 / colortail

Like the tail command line utility but with colors
GNU General Public License v2.0
126 stars 23 forks source link

Colortail emits an extra NULL after each EOL #2

Open phord opened 13 years ago

phord commented 13 years ago

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 commented 13 years ago

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

DrOwl commented 10 years ago

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