about summary refs log tree commit
path: root/ui-diff.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-diff.c')
-rw-r--r--ui-diff.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/ui-diff.c b/ui-diff.c
index c60aefd..1dbba2c 100644
--- a/ui-diff.c
+++ b/ui-diff.c
@@ -222,7 +222,6 @@ static void cgit_print_diffstat(const struct object_id *old_oid,
 static void print_line(char *line, int len)
 {
         char *class = "ctx";
-        char c = line[len-1];
 
         if (line[0] == '+')
                 class = "add";
@@ -232,10 +231,8 @@ static void print_line(char *line, int len)
                 class = "hunk";
 
         htmlf("<div class='%s'>", class);
-        line[len-1] = '\0';
-        html_txt(line);
+        html_ntxt_pre(line, len - 1);
         html("</div>");
-        line[len-1] = c;
 }
 
 static void header(const struct object_id *oid1, char *path1, int mode1,