From 1e23fc956c4660d9d73b99372d2fde6632d22d90 Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Mon, 16 Nov 2015 18:57:10 +0000
Subject: [PATCH] When setting dk.console.sttr to a string, start with the
 normal attribute, not the current one.  This matches Synchronet usage.

---
 exec/load/dorkit.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/exec/load/dorkit.js b/exec/load/dorkit.js
index 3305e80655..4c3a999329 100644
--- a/exec/load/dorkit.js
+++ b/exec/load/dorkit.js
@@ -200,6 +200,8 @@ var dk = {
 					break;
 			}
 		},
+		_orig_attr:new Attribute(7),
+		_next_attr:new Attribute(7),
 
 		get attr() {
 			return this._attr;
@@ -208,8 +210,10 @@ var dk = {
 			function handle_string(str, obj) {
 				var i;
 
+				obj._next_attr.value = 7;
 				for (i=0; i<val.length; i++)
-					obj.ctrla_attr(str[i], obj.attr);
+					obj.ctrla_attr(str[i], obj._next_attr);
+				obj.attr.value = obj._next_attr.value;
 			}
 
 			if (typeof(val)=='object') {
@@ -239,8 +243,6 @@ var dk = {
 		 * Returns a string with ^A codes converted to ANSI or stripped
 		 * as appropriate.
 		 */
-		_orig_attr:new Attribute(7),
-		_next_attr:new Attribute(7),
 		parse_ctrla:function(txt, orig_attr) {
 			var ret='';
 			var i;
-- 
GitLab