diff options
author | Dmitry Kakurin <Dmitry.Kakurin@gmail.com> | 2008-07-11 18:48:16 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-07-11 21:14:27 -0700 |
commit | f9dd4bf4e58af0b4828c7e7013080dba59f8a6b9 (patch) | |
tree | f25047e234a34d4d3a66215478c0b777cc6a5003 | |
parent | a9a3e82e6d0018ff42ec11fd9560c1ff47add824 (diff) | |
download | git-f9dd4bf4e58af0b4828c7e7013080dba59f8a6b9.tar.gz git-f9dd4bf4e58af0b4828c7e7013080dba59f8a6b9.tar.xz |
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>
-rw-r--r-- | convert.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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--; } /* |