Commit Diff


commit - c52931e3617c3dce87bce08dc21e14d45ba5cb177b82c888dddfc20e88147d9e
commit + 4adf9a5039c8b1ceaf7020883aa9d00d8bcf17610c7bad027c74ef82da626a00
blob - 0645d957d1b5ca92447917beba39af5d7c255097ebdb283447f4f400bcdab9f4
blob + b0008e8087d94e7cbb75cff81f26de5d6256667cd568614aff73eef0adb3fe2d
--- tog/tog.c	
+++ tog/tog.c	
@@ -5938,7 +5938,7 @@ write_commit_info(struct got_diff_line **lines, size_t
 	char *id_str = NULL, *logmsg = NULL, *s = NULL, *line;
 	time_t committer_time;
 	const char *author, *committer;
-	char *refs_str = NULL;
+	char *refs_str = NULL, *exstr = NULL;
 	off_t outoff = 0;
 	int n;
 
@@ -6039,11 +6039,16 @@ write_commit_info(struct got_diff_line **lines, size_t
 		goto done;
 	s = logmsg;
 	while ((line = strsep(&s, "\n")) != NULL) {
-		n = fprintf(outfile, " %s\n", line);
+		err = expand_tab(&exstr, line);
+		if (err)
+			goto done;
+		n = fprintf(outfile, " %s\n", exstr);
 		if (n < 0) {
 			err = got_error_from_errno("fprintf");
 			goto done;
 		}
+		free(exstr);
+		exstr = NULL;
 		outoff += n;
 		err = add_line_metadata(lines, nlines, outoff,
 		    GOT_DIFF_LINE_LOGMSG);
@@ -6052,6 +6057,7 @@ write_commit_info(struct got_diff_line **lines, size_t
 	}
 
 done:
+	free(exstr);
 	free(id_str);
 	free(logmsg);
 	free(refs_str);