summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-11-23 01:27:17 -0500
committerMike Frysinger <vapier@gentoo.org>2012-11-23 01:33:04 -0500
commit38241c15b80790efb11b1c128a3277900a89191b (patch)
treec7cb4d584d116bc76fade4446f27a27ce80684fc
parentrequire at least automake 1.12 (diff)
downloadsandbox-38241c15b80790efb11b1c128a3277900a89191b.tar.gz
sandbox-38241c15b80790efb11b1c128a3277900a89191b.tar.bz2
sandbox-38241c15b80790efb11b1c128a3277900a89191b.zip
sb_efuncs: fix NOCOLOR handling
Need to set the colors to "" rather than NULL so we don't print out "(null)" where the colors normally would be. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--libsbutil/sb_efuncs.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libsbutil/sb_efuncs.c b/libsbutil/sb_efuncs.c
index 248c2bd..5a86d25 100644
--- a/libsbutil/sb_efuncs.c
+++ b/libsbutil/sb_efuncs.c
@@ -44,8 +44,11 @@ const char *colors[] = {
__attribute__((constructor))
static void sbio_init(void)
{
- if (is_env_on(ENV_NOCOLOR))
- memset(colors, 0, sizeof(colors));
+ if (is_env_on(ENV_NOCOLOR)) {
+ size_t i;
+ for (i = 0; i < ARRAY_SIZE(colors); ++i)
+ colors[i] = "";
+ }
}
static bool try_portage_helpers = false;