[PATCH] Fix parsing numeric color values
Fix bug reported by Chris Larson <clarson@kergoth.com>. Numeric color
only worked if it was at end of line.
---
color.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/color.c b/color.c
index 7f66c29..3c999c3 100644
--- a/color.c
+++ b/color.c
@@ -17,7 +17,7 @@ static int parse_color(const char *name, int len)
return i - 1;
}
i = strtol(name, &end, 10);
- if (*name && !*end && i >= -1 && i <= 255)
+ if (*name && (!*end || isspace(*end)) && i >= -1 && i <= 255)
return i;
return -2;
}
--
1.5.4.1134.ge34cf-dirty