Re: [PATCH] Fixed text file auto-detection: treat EOF character 032 at the end of file as printable
- From
Steffen Prohaska <prohaska@zib.de>
- Date
- Jul 11, 2008, 20:32 UTC
- Message-ID
- <920CBA3F-779D-4861-B447-135690B4E8BD@zib.de>
- In-Reply-To
- <alpine.DEB.1.00.0807111940420.8950@racer>
On Jul 11, 2008, at 8:42 PM, Johannes Schindelin wrote:
Show 28 quoted lines
> On Fri, 11 Jul 2008, Steffen Prohaska wrote: > >> From: Dmitry Kakurin <Dmitry.Kakurin@gmail.com> >> >> Signed-off-by: Dmitry Kakurin <Dmitry.Kakurin@gmail.com> >> Signed-off-by: Steffen Prohaska <prohaska@zib.de> >> --- >> convert.c | 4 ++++ >> 1 files changed, 4 insertions(+), 0 deletions(-) >> >> diff --git a/convert.c b/convert.c >> index 352b69d..78efed8 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--; > > This is one of the things that are very specific to Windows and > should not > affect other people.
Does this mean you are opposed to this change?
Junio thinks that "the intention of this change is good" [1]. Hence, I cleaned up the style and re-send the patch.
[1] http://article.gmane.org/gmane.comp.version-control.git/87122
Steffen