summaryrefslogtreecommitdiffstats
path: root/format.c
diff options
context:
space:
mode:
authornicm <nicm>2014-11-08 12:50:38 +0000
committernicm <nicm>2014-11-08 12:50:38 +0000
commitc6129f9c09ddc08d24640eeff1aa3082535f13c1 (patch)
treeb1b991b5c5b3fa618a863182d38031a111fdb150 /format.c
parent3c12b477d3563057a55026f4f4583f12537d9096 (diff)
Empty strings should be false too for #{?}, from Marc Finet.
Diffstat (limited to 'format.c')
-rw-r--r--format.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/format.c b/format.c
index 441e61be..72991047 100644
--- a/format.c
+++ b/format.c
@@ -236,7 +236,8 @@ format_replace(struct format_tree *ft, const char *key, size_t keylen,
*ptr = '\0';
value = format_find(ft, copy + 1);
- if (value != NULL && (value[0] != '0' || value[1] != '\0')) {
+ if (value != NULL && *value != '\0' &&
+ (value[0] != '0' || value[1] != '\0')) {
value = ptr + 1;
ptr = strchr(value, ',');
if (ptr == NULL)