Browse Source

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>
maint
Dmitry Kakurin 17 years ago committed by Junio C Hamano
parent
commit
f9dd4bf4e5
  1. 4
      convert.c

4
convert.c

@ -61,6 +61,10 @@ static void gather_stats(const char *buf, unsigned long size, struct text_stat * @@ -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--;
}

/*

Loading…
Cancel
Save