From: Julius Plenz Date: Thu, 15 Nov 2012 16:35:06 +0000 (+0100) Subject: ssdiff: correctly manage tab expansion X-Git-Tag: v0.9.2~96 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=225c8aba3171156fb917abe043ea55797e2cc1f9;p=cgit ssdiff: correctly manage tab expansion Previously, replace_tabs("foo\tbar") would become " foobar". Signed-off-by: Julius Plenz Signed-off-by: Jason A. Donenfeld --- diff --git a/ui-ssdiff.c b/ui-ssdiff.c index 7108779..3d3dad6 100644 --- a/ui-ssdiff.c +++ b/ui-ssdiff.c @@ -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; }