[Asterisk-code-review] term: send proper reset sequence when black background is fo... (asterisk[master])

Matt Jordan asteriskteam at digium.com
Sun May 3 10:54:13 CDT 2015


Matt Jordan has submitted this change and it was merged.

Change subject: term: send proper reset sequence when black background is forced
......................................................................


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
---
M main/term.c
1 file changed, 1 insertion(+), 2 deletions(-)

Approvals:
  Matt Jordan: Looks good to me, approved; Verified
  George Joseph: Looks good to me, but someone else must approve



diff --git a/main/term.c b/main/term.c
index a19c1f1..cf21719 100644
--- a/main/term.c
+++ b/main/term.c
@@ -311,8 +311,7 @@
 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;
 	}

-- 
To view, visit https://gerrit.asterisk.org/332
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I56323899123ae3264900389cae1f5b252aa3bf43
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: dant <d at tucny.com>
Gerrit-Reviewer: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-code-review mailing list