aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Ludd <solar@gentoo.org>2006-12-30 19:43:36 +0000
committerNed Ludd <solar@gentoo.org>2006-12-30 19:43:36 +0000
commiteabc0801884eccd8183e6659b8eb795e86219b13 (patch)
tree11c66d5077a0db1a8c87480c1677d3e52a14ce94 /libq/colors.c
parent- keep fbsd happy (diff)
downloadportage-utils-eabc0801884eccd8183e6659b8eb795e86219b13.tar.gz
portage-utils-eabc0801884eccd8183e6659b8eb795e86219b13.tar.bz2
portage-utils-eabc0801884eccd8183e6659b8eb795e86219b13.zip
- make error msg more verbose when dealing with RGB values in color mappings
Diffstat (limited to 'libq/colors.c')
-rw-r--r--libq/colors.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libq/colors.c b/libq/colors.c
index 8895449..90aca9d 100644
--- a/libq/colors.c
+++ b/libq/colors.c
@@ -58,11 +58,13 @@ void color_remap(void)
int i;
char buf[512];
char *p;
+ int lineno = 0;
if ((fp = fopen(COLOR_MAP, "r")) == NULL)
return;
while (fgets(buf, sizeof(buf), fp) != NULL) {
+ lineno++;
/* eat comments */
if ((p = strchr(buf, '#')) != NULL)
*p = '\0';
@@ -81,7 +83,7 @@ void color_remap(void)
for (i = 0; i < ARR_SIZE(color_pairs); ++i)
if (strcmp(buf, color_pairs[i].name) == 0) {
if (strncmp(p, "0x", 2) == 0)
- warn("[%s] RGB values in color map are not supported", buf);
+ warn("[%s=%s] RGB values in color map are not supported on line %d of %s", buf, p, lineno, COLOR_MAP);
else
snprintf(color_pairs[i].value, sizeof(color_pairs[i].value), "\e[%s", p);
}