Procházet zdrojové kódy

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

Serj Kalichev před 2 roky
rodič
revize
868a57821d
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  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 "";