From: Dmitry Kakurin Date: Fri, 11 Jul 2008 16:48:16 +0000 (+0200) Subject: Fixed text file auto-detection: treat EOF character 032 at the end of file as printable X-Git-Tag: v1.6.0-rc0~53^2~2 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=f9dd4bf4e58af0b4828c7e7013080dba59f8a6b9;p=git.git Fixed text file auto-detection: treat EOF character 032 at the end of file as printable Signed-off-by: Dmitry Kakurin Signed-off-by: Steffen Prohaska Signed-off-by: Junio C Hamano --- diff --git a/convert.c b/convert.c index 352b69d4c..78efed800 100644 --- a/convert.c +++ b/convert.c @@ -61,6 +61,10 @@ static void gather_stats(const char *buf, unsigned long size, struct text_stat * else 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--; } /*