ssdiff: correctly manage tab expansion

Previously, replace_tabs("foo\tbar") would become "        foobar".

Signed-off-by: Julius Plenz <plenz@cis.fu-berlin.de>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Julius Plenz 2012-11-15 17:35:06 +01:00 зафіксовано Jason A. Donenfeld
джерело b1e172acca
коміт 225c8aba31

@ -138,9 +138,8 @@ static char *replace_tabs(char *line)
strcat(result, prev_buf);
break;
} else {
strcat(result, " ");
strncat(result, spaces, 8 - (strlen(result) % 8));
strncat(result, prev_buf, cur_buf - prev_buf);
strncat(result, spaces, 8 - (strlen(result) % 8));
}
prev_buf = cur_buf + 1;
}