From: D Tucny Date: Sat, 2 May 2015 00:50:22 +0000 (-0400) Subject: term: send proper reset sequence when black background is forced X-Git-Tag: 13.4.0-rc1~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92120247e99865d97a85461b08ba763e961e6232;p=thirdparty%2Fasterisk.git term: send proper reset sequence when black background is forced When using the force black background command-line option or configuration option an invalid reset sequence is sent following a coloured output item in the CLI, the result is that the colour is not 'turned off' and continues until the next non-default coloured text output. A reset sequence is already defined in term.c, but the ast_term_reset function doesn't use it, instead building it's own invalid sequence and returning that. This patch changes that behaviour, removing the building of a reset sequence and instead using the pre-built constant 'enddata' which is a suitable reset sequence for this purpose. ASTERISK-24896 #close Reported by: Dan Tucny Change-Id: I56323899123ae3264900389cae1f5b252aa3bf43 --- diff --git a/main/term.c b/main/term.c index 2e28032a79..871a7cb3ce 100644 --- a/main/term.c +++ b/main/term.c @@ -311,8 +311,7 @@ const char *ast_term_color(int fgcolor, int bgcolor) const char *ast_term_reset(void) { if (ast_opt_force_black_background) { - static const char reset[] = { ESC, '[', COLOR_BLACK + 10, 'm', 0 }; - return reset; + return enddata; } else { return quitdata; }