Fixed text file auto-detection: treat EOF character 032 at the end of file as printable
Signed-off-by: Dmitry Kakurin <Dmitry.Kakurin@gmail.com> Signed-off-by: Steffen Prohaska <prohaska@zib.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
a9a3e82e6d
commit
f9dd4bf4e5
@ -61,6 +61,10 @@ static void gather_stats(const char *buf, unsigned long size, struct text_stat *
|
|||||||
else
|
else
|
||||||
stats->printable++;
|
stats->printable++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If file ends with EOF then don't count this EOF as non-printable. */
|
||||||
|
if (size >= 1 && buf[size-1] == '\032')
|
||||||
|
stats->nonprintable--;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user