summaryrefslogtreecommitdiff
path: root/convert.c
diff options
context:
space:
mode:
authorDmitry Kakurin <Dmitry.Kakurin@gmail.com>2008-07-11 18:48:16 +0200
committerJunio C Hamano <gitster@pobox.com>2008-07-11 21:14:27 -0700
commitf9dd4bf4e58af0b4828c7e7013080dba59f8a6b9 (patch)
treef25047e234a34d4d3a66215478c0b777cc6a5003 /convert.c
parenta9a3e82e6d0018ff42ec11fd9560c1ff47add824 (diff)
downloadgit-f9dd4bf4e58af0b4828c7e7013080dba59f8a6b9.tar.gz
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>
Diffstat (limited to 'convert.c')
-rw-r--r--convert.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/convert.c b/convert.c
index 352b69d4ce..78efed800d 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--;
}
/*