diff options
author | Julius Plenz | 2012-11-15 17:35:06 +0100 |
---|---|---|
committer | Jason A. Donenfeld | 2013-02-01 13:46:47 +0100 |
commit | 225c8aba3171156fb917abe043ea55797e2cc1f9 (patch) | |
tree | 7d6ed1520a4ae3a46fba6a8404dd0318c1c63d9b /ui-ssdiff.c | |
parent | b1e172acca870e7999f2d2d917db7b4c42aa05b3 (diff) | |
download | cgit-225c8aba3171156fb917abe043ea55797e2cc1f9.tar.gz cgit-225c8aba3171156fb917abe043ea55797e2cc1f9.tar.bz2 cgit-225c8aba3171156fb917abe043ea55797e2cc1f9.zip |
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>
Diffstat (limited to 'ui-ssdiff.c')
-rw-r--r-- | ui-ssdiff.c | 3 |
1 files changed, 1 insertions, 2 deletions
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) | |||
138 | strcat(result, prev_buf); | 138 | strcat(result, prev_buf); |
139 | break; | 139 | break; |
140 | } else { | 140 | } else { |
141 | strcat(result, " "); | ||
142 | strncat(result, spaces, 8 - (strlen(result) % 8)); | ||
143 | strncat(result, prev_buf, cur_buf - prev_buf); | 141 | strncat(result, prev_buf, cur_buf - prev_buf); |
142 | strncat(result, spaces, 8 - (strlen(result) % 8)); | ||
144 | } | 143 | } |
145 | prev_buf = cur_buf + 1; | 144 | prev_buf = cur_buf + 1; |
146 | } | 145 | } |