[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cgit
Subject:    [PATCH v2] bugfix: make ss-diff correctly handle tab expansion
From:       plenz () cis ! fu-berlin ! de (Julius Plenz)
Date:       2012-11-15 16:35:06
Message-ID: 1352997306-253443-1-git-send-email-plenz () cis ! fu-berlin ! de
[Download RAW message or body]

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

Signed-off-by: Julius Plenz <plenz at cis.fu-berlin.de>
---
 ui-ssdiff.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/ui-ssdiff.c b/ui-ssdiff.c
index c54f7a0..6fe2268 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;
 	}
-- 
1.7.12.3-zedat




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic