Browse Source

stripspace: incomplete line fix (take #2)

This fixes f4ee3eb689 breakage, which
added an extra trailing blank line after stripping trailing blank lines
by mistake.

Signed-off-by: Junio C Hamano <junkio@cox.net>
maint
Junio C Hamano 19 years ago
parent
commit
5cf7e21fbc
  1. 4
      stripspace.c

4
stripspace.c

@ -12,7 +12,9 @@ static int cleanup(char *line) @@ -12,7 +12,9 @@ static int cleanup(char *line)
{
int len = strlen(line);

if (len > 1 && line[len-1] == '\n') {
if (len && line[len-1] == '\n') {
if (len == 1)
return 0;
do {
unsigned char c = line[len-2];
if (!isspace(c))

Loading…
Cancel
Save