vo_tct: fix --vo-tct-256

This is a regression from cbbd81bb (the previous commit):

print_seq1 (which prints a sequence with 1 parametric byte value) is
used with 256 colors output, and apparently was never tested.
Two issues were introduced at the offending commit:

1. The ";5" part was incorrectly removed from the strings
   ESC_COLOR256_{BG,FG} (affects both *nix and Windows).

2. On windows only - a semicolon was not used after the prefix.

Both issues resulted in an invalid 256 colors sequences and output.
This commit is contained in:
Avi Halachmi (:avih) 2021-08-16 10:58:46 +03:00
parent cbbd81bb4f
commit 36de2efebd
1 changed files with 3 additions and 3 deletions

View File

@ -45,8 +45,8 @@
#define ESC_GOTOXY "\033[%d;%df"
#define ESC_COLOR_BG "\033[48;2"
#define ESC_COLOR_FG "\033[38;2"
#define ESC_COLOR256_BG "\033[48"
#define ESC_COLOR256_FG "\033[38"
#define ESC_COLOR256_BG "\033[48;5"
#define ESC_COLOR256_FG "\033[38;5"
#define DEFAULT_WIDTH 80
#define DEFAULT_HEIGHT 25
@ -145,7 +145,7 @@ static void print_seq1(struct lut_item *lut, const char* prefix, uint8_t c)
fwrite(lut[c].str, lut[c].width, 1, stdout);
fputc('m', stdout);
#else
printf("%s%dm", prefix, (int)c);
printf("%s;%dm", prefix, (int)c);
#endif
}