summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.housekeeping4
-rw-r--r--src/core/debug.c12
2 files changed, 11 insertions, 5 deletions
diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping
index 70ec50c5e..0a80d2ac9 100644
--- a/src/Makefile.housekeeping
+++ b/src/Makefile.housekeeping
@@ -734,8 +734,8 @@ $(DBGCOL_LIST) : $(MAKEDEPS)
VERYCLEANUP += $(DBGCOL_LIST)
DBGCOL_COLOURS := $(subst -, ,$(DBGCOL))
-DBGCOL_MIN := $(word 1,$(DBGCOL_COLOURS))
-DBGCOL_MAX := $(word 2,$(DBGCOL_COLOURS))
+DBGCOL_MIN := $(firstword $(DBGCOL_COLOURS))
+DBGCOL_MAX := $(lastword $(DBGCOL_COLOURS))
debug_DEPS += $(DBGCOL_LIST)
diff --git a/src/core/debug.c b/src/core/debug.c
index def5d8b09..9b2a823f5 100644
--- a/src/core/debug.c
+++ b/src/core/debug.c
@@ -194,8 +194,12 @@ static int dbg_autocolour ( unsigned long stream ) {
* @v stream Message stream ID
*/
void dbg_autocolourise ( unsigned long stream ) {
- dbg_printf ( "\033[%dm",
- ( stream ? ( DBGCOL_MIN + dbg_autocolour ( stream ) ) :0));
+
+ if ( DBGCOL_MIN ) {
+ dbg_printf ( "\033[%dm",
+ ( stream ?
+ ( DBGCOL_MIN + dbg_autocolour ( stream ) ) : 0));
+ }
}
/**
@@ -203,5 +207,7 @@ void dbg_autocolourise ( unsigned long stream ) {
*
*/
void dbg_decolourise ( void ) {
- dbg_printf ( "\033[0m" );
+
+ if ( DBGCOL_MIN )
+ dbg_printf ( "\033[0m" );
}