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:
Dmitry Kakurin 2008-07-11 18:48:16 +02:00 committed by Junio C Hamano
parent a9a3e82e6d
commit f9dd4bf4e5

View File

@ -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--;
}
/*