From 4f78bdba6d65d6135bcb7d2be090fc26f63a305b Mon Sep 17 00:00:00 2001 From: Jason Hood Date: Fri, 1 Jun 2012 23:42:58 +1000 Subject: [PATCH] Implemented \e[39m & \e[49m. --- ANSI.c | 36 ++++++++++++++++++++++-------------- ansicon.c | 2 +- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/ANSI.c b/ANSI.c index d6b8425..c5f8c85 100644 --- a/ANSI.c +++ b/ANSI.c @@ -82,8 +82,9 @@ fix 32-bit process trying to identify 64-bit process; hook _lwrite & _hwrite. - v1.52, 10 April, 2012: - use ansicon.exe to enable 32-bit to inject into 64-bit. + v1.52, 10 April & 1 June, 2012: + use ansicon.exe to enable 32-bit to inject into 64-bit; + implement \e[39m & \e[49m (only setting color, nothing else). */ #include "ansicon.h" @@ -387,6 +388,8 @@ void InterpretEscSeq( void ) else switch (es_argv[i]) { case 0: + case 39: + case 49: { TCHAR def[4]; int a; @@ -399,20 +402,25 @@ void InterpretEscSeq( void ) grm.reverse = TRUE; a = -a; } - grm.foreground = attr2ansi[a & 7]; - grm.background = attr2ansi[(a >> 4) & 7]; - if (es_argc == 1) + if (es_argv[i] != 49) + grm.foreground = attr2ansi[a & 7]; + if (es_argv[i] != 39) + grm.background = attr2ansi[(a >> 4) & 7]; + if (es_argv[i] == 0) { - grm.bold = a & FOREGROUND_INTENSITY; - grm.underline = a & BACKGROUND_INTENSITY; + if (es_argc == 1) + { + grm.bold = a & FOREGROUND_INTENSITY; + grm.underline = a & BACKGROUND_INTENSITY; + } + else + { + grm.bold = 0; + grm.underline = 0; + } + grm.rvideo = 0; + grm.concealed = 0; } - else - { - grm.bold = 0; - grm.underline = 0; - } - grm.rvideo = 0; - grm.concealed = 0; } break; diff --git a/ansicon.c b/ansicon.c index 7b06956..053f8a7 100644 --- a/ansicon.c +++ b/ansicon.c @@ -66,7 +66,7 @@ pass process & thread identifiers on the command line (for x86->x64). */ -#define PDATE L"10 April, 2012" +#define PDATE L"1 June, 2012" #include "ansicon.h" #include "version.h"