From b847d1d8e7a032afa51c7ccce1b253ec451bb6b7 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Thu, 21 Nov 2013 12:55:39 +1000 Subject: Color output from pm_vasprintf This makes sure warning and error messages from _alpm_log are colored. Fixes FS#35160. Signed-off-by: Allan McRae --- src/pacman/util.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/pacman/util.c b/src/pacman/util.c index 23eea982..05135d76 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -1593,10 +1593,12 @@ int pm_vasprintf(char **string, alpm_loglevel_t level, const char *format, va_li /* print a prefix to the message */ switch(level) { case ALPM_LOG_ERROR: - pm_asprintf(string, _("error: %s"), msg); + pm_asprintf(string, "%s%s%s%s", config->colstr.err, _("error: "), + config->colstr.nocolor, msg); break; case ALPM_LOG_WARNING: - pm_asprintf(string, _("warning: %s"), msg); + pm_asprintf(string, "%s%s%s%s", config->colstr.warn, _("warning: "), + config->colstr.nocolor, msg); break; case ALPM_LOG_DEBUG: pm_asprintf(string, "debug: %s", msg); -- cgit v1.2.3-70-g09d2