Explorar o código

show: Don't output ESC characters for non-diff show operation

Serj Kalichev %!s(int64=3) %!d(string=hai) anos
pai
achega
868a57821d
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/show.c

+ 1 - 1
src/show.c

@@ -96,7 +96,7 @@ static const char *diff_prefix(enum diff_op op, uint32_t flags)
 
 static const char *diff_suffix(enum diff_op op, uint32_t flags)
 {
-	if (flags & PPARSE_COLORIZE)
+	if ((flags & PPARSE_COLORIZE) && (DIFF_OP_NONE != op))
 		return "\x1b[0m";
 
 	return "";