From 01e3a15dd29ccbb1bca252c0da6b37a3f2dce958 Mon Sep 17 00:00:00 2001 From: Dmitry Kakurin Date: Wed, 5 Sep 2007 04:32:50 -0700 Subject: [PATCH] Fixed text file auto-detection: treat EOF character 032 at the end of file as printable Signed-off-by: Dmitry Kakurin --- convert.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/convert.c b/convert.c index 21908b1039..b288552280 100644 --- a/convert.c +++ b/convert.c @@ -58,6 +58,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--; } /*