summaryrefslogtreecommitdiff
path: root/src/colors.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/colors.c')
-rw-r--r--src/colors.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/colors.c b/src/colors.c
index be4cb306..264c7357 100644
--- a/src/colors.c
+++ b/src/colors.c
@@ -246,7 +246,7 @@ static int32_t Color_parse_hex (const char *s, int32_t default_color, int *err)
* 0 if a color beginning with '#' is successfully parsed
* or the color is a recognized word.
* 1 if the color is bare hex or can't be parsed at all.
- * 2 if a color begins with 0[xX].
+ * 2 if a color beginning with 0[xX] is successfully parsed.
*/
int32_t a_Color_parse (const char *subtag, int32_t default_color, int *err)
{
@@ -263,8 +263,8 @@ int32_t a_Color_parse (const char *subtag, int32_t default_color, int *err)
} else if (*cp == '0' && (cp[1] == 'x' || cp[1] == 'X') ) {
ret_color = Color_parse_hex(cp + 2, default_color, &st);
- st = 2;
-
+ if (!st)
+ st = 2;
} else {
/* Binary search */
low = 0;