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>
This commit is contained in:
Dmitry Kakurin
2007-09-05 04:32:50 -07:00
parent 9c792c5545
commit 01e3a15dd2

View File

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