summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2013-11-21 12:55:39 +1000
committerAllan McRae <allan@archlinux.org>2013-12-15 20:09:37 +1000
commitb847d1d8e7a032afa51c7ccce1b253ec451bb6b7 (patch)
tree70974f6893f01f544e3147da1b5c7fd7901d210b /src
parent9749fb033c8794e8ac4b931678659aa2b79ae1b1 (diff)
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 <allan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/util.c6
1 files changed, 4 insertions, 2 deletions
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);