Commit b74d4478 by crazymaster

Fix the initial line

parent 19bee769
...@@ -261,34 +261,29 @@ bool git_buf_text_gather_stats( ...@@ -261,34 +261,29 @@ bool git_buf_text_gather_stats(
/* Counting loop */ /* Counting loop */
while (scan < end) { while (scan < end) {
unsigned char c = *scan++; unsigned char c = *scan++;
if (c == '\r') {
stats->cr++; if (c > 0x1F && c != 0x7F)
if (scan < end && *scan == '\n') stats->printable++;
stats->crlf++; else switch (c) {
continue; case '\0':
} stats->nul++;
if (c == '\n') { stats->nonprintable++;
stats->lf++; break;
continue; case '\n':
} stats->lf++;
if (c == 127) break;
/* DEL */ case '\r':
stats->nonprintable++; stats->cr++;
else if (c < 32) { if (scan < end && *scan == '\n')
switch (c) { stats->crlf++;
/* BS, HT, ESC and FF */ break;
case '\b': case '\t': case '\033': case '\014': case '\t': case '\f': case '\v': case '\b': case 0x1b: /*ESC*/
stats->printable++; stats->printable++;
break; break;
case 0:
stats->nul++;
/* fall through */
default: default:
stats->nonprintable++; stats->nonprintable++;
break;
} }
}
else
stats->printable++;
} }
return (stats->nul > 0 || return (stats->nul > 0 ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment