mailsplit and mailinfo: gracefully handle NUL characters

The function fgets() has a big problem with NUL characters: it reads
them, but nobody will know if the NUL comes from the file stream, or
was appended at the end of the line.

So implement a custom read_line_with_nul() function.

Noticed by Tommy Thorn.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Johannes Schindelin
2008-05-16 14:03:30 +01:00
committed by Junio C Hamano
parent 182fb4df91
commit cce8d6fdb4
5 changed files with 46 additions and 15 deletions

BIN
t/t5100/nul Normal file

Binary file not shown.