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:
parent
b1e172acca
commit
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user