summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2019-03-20 08:02:38 +0000
committerThomas Adam <thomas@xteddy.org>2019-03-20 08:02:38 +0000
commitbff957a475fdfc3b06615e388471499d8387a41e (patch)
tree47f77ccfe930b9610ee5fb5e9bf2ecc5f5451b96
parent46f642b030e949b23de482ea1f9a27ace6f4cf92 (diff)
parented962e76129d499012bee92617620d3703245482 (diff)
Merge branch 'obsd-master'
-rw-r--r--format-draw.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/format-draw.c b/format-draw.c
index a3bd4351..dd03435c 100644
--- a/format-draw.c
+++ b/format-draw.c
@@ -527,6 +527,7 @@ format_draw(struct screen_write_ctx *octx, const struct grid_cell *base,
style_set(&sy, base);
TAILQ_INIT(&frs);
+ log_debug("%s: %s", __func__, expanded);
/*
* We build three screens for left, right, centre alignment, one for
@@ -574,14 +575,22 @@ format_draw(struct screen_write_ctx *octx, const struct grid_cell *base,
/* This is a style. Work out where the end is and parse it. */
end = format_skip(cp + 2, "]");
- if (end == NULL)
- return;
+ if (end == NULL) {
+ log_debug("%s: no terminating ] at '%s'", __func__,
+ cp + 2);
+ TAILQ_FOREACH_SAFE(fr, &frs, entry, fr1)
+ format_free_range(&frs, fr);
+ goto out;
+ }
tmp = xstrndup(cp + 2, end - (cp + 2));
if (style_parse(&sy, base, tmp) != 0) {
+ log_debug("%s: invalid style '%s'", __func__, tmp);
free(tmp);
- return;
+ cp = end + 1;
+ continue;
}
- log_debug("style '%s' -> '%s'", tmp, style_tostring(&sy));
+ log_debug("%s: style '%s' -> '%s'", __func__, tmp,
+ style_tostring(&sy));
free(tmp);
/* Check the list state. */
@@ -699,7 +708,7 @@ format_draw(struct screen_write_ctx *octx, const struct grid_cell *base,
log_debug("%s: width %s is %u", __func__, names[i], width[i]);
}
if (focus_start != -1 && focus_end != -1)
- log_debug("focus is %d-%d", focus_start, focus_end);
+ log_debug("%s: focus %d-%d", __func__, focus_start, focus_end);
TAILQ_FOREACH(fr, &frs, entry) {
log_debug("%s: range %d|%u is %s %u-%u", __func__, fr->type,
fr->argument, names[fr->index], fr->start, fr->end);
@@ -750,6 +759,7 @@ format_draw(struct screen_write_ctx *octx, const struct grid_cell *base,
format_free_range(&frs, fr);
}
+out:
/* Free the screens. */
for (i = 0; i < TOTAL; i++)
screen_free(&s[i]);