[asterisk-commits] term: send proper reset sequence when black background is fo... (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun May 3 10:54:06 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 2e28032..871a7cb 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/342
To unsubscribe, visit https://gerrit.asterisk.org/settings

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



More information about the asterisk-commits mailing list