[pacman-dev] [PATCH 08/15] colourize colon_printf and question
Simon Gomizelj
simongmzlj at gmail.com
Wed Mar 6 12:51:49 EST 2013
Signed-off-by: Simon Gomizelj <simongmzlj at gmail.com>
---
src/pacman/util.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/pacman/util.c b/src/pacman/util.c
index f326849..bbc2d88 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -1496,7 +1496,7 @@ static int question(short preset, const char *format, va_list args)
fflush(stdout);
fflush(stderr);
- fprintf(stream, ":: ");
+ fputs(config->colstr.colon, stream);
vfprintf(stream, format, args);
if(preset) {
@@ -1505,6 +1505,9 @@ static int question(short preset, const char *format, va_list args)
fprintf(stream, " %s ", _("[y/N]"));
}
+ fputs(config->colstr.nocolor, stream);
+ fflush(stream);
+
if(config->noconfirm) {
fprintf(stream, "\n");
return preset;
@@ -1563,11 +1566,13 @@ int colon_printf(const char *fmt, ...)
int ret;
va_list args;
- fputs(":: ", stdout);
va_start(args, fmt);
+ fputs(config->colstr.colon, stdout);
ret = vprintf(fmt, args);
+ fputs(config->colstr.nocolor, stdout);
va_end(args);
+ fflush(stdout);
return ret;
}
--
1.8.1.5
More information about the pacman-dev
mailing list