about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJulius Plenz <plenz@cis.fu-berlin.de>2012-11-15 17:35:06 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2013-02-01 13:46:47 +0100
commit225c8aba3171156fb917abe043ea55797e2cc1f9 (patch)
tree7d6ed1520a4ae3a46fba6a8404dd0318c1c63d9b
parentMake "owner" column on index page configurable (diff)
downloadcgit-pink-225c8aba3171156fb917abe043ea55797e2cc1f9.tar.gz
cgit-pink-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 '')
-rw-r--r--ui-ssdiff.c3
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)
 			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;
 	}
ve libutil dependencyJune McEnroe This makes the server much more portable. 2021-02-04Update play@ascii.town descriptionJune McEnroe 2021-02-04Replace donation button with LiberapayJune McEnroe 2020-06-25Use DisableForwarding in sshd_configJune McEnroe 2019-12-19Remove READMEJune McEnroe 2019-12-15Update git URLsJune McEnroe 2019-08-05Add buymeacoffee linkJune McEnroe Can't hurt, I guess? I don't expect to get anything... 2019-07-27Use braces in MakefileJune McEnroe 2019-07-08Remove NetHack from indexJune McEnroe 2019-04-08Don't install rc.kfcgi eitherJune McEnroe 2019-03-28Remove rc.kfcgiJune McEnroe I sent a better version of it to the port maintainer and it is now in the ports tree. 2019-01-16Reformat index.html with explore linkJune McEnroe 2019-01-16Return false from keydown handler in exploreJune McEnroe 2019-01-08Draw lines to tile edgeJune McEnroe 2019-01-08Factor out default pathsJune McEnroe 2019-01-08Remove incorrect default coordinatesJune McEnroe 2019-01-07Set img src when explore fragment changesJune McEnroe 2019-01-07Compress PNG data in imageJune McEnroe kcgi never enables compression for FastCGI. 2019-01-07madvise MADV_NOCORE in imageJune McEnroe 2019-01-07Add license notice to explore JavaScriptJune McEnroe 2019-01-07Add Q/Home binding in exploreJune McEnroe 2019-01-07Fix explore image URLJune McEnroe 2019-01-07Add HOME button, ssh link, AGPL notice to exploreJune McEnroe 2019-01-06Add meta viewport to exploreJune McEnroe 2019-01-06Set background and max-width in exploreJune McEnroe 2019-01-06Swallow writes after the connection is closedJune McEnroe It was not okay. 2019-01-06Handle KCGI_HUPJune McEnroe I hope it's okay that I keep writing to the fwopen stream after streamWrite returns -1. 2019-01-06Install html filesJune McEnroe