Explorar el Código

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

Serj Kalichev hace 3 años
padre
commit
868a57821d
Se han modificado 1 ficheros con 1 adiciones y 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 "";