summaryrefslogtreecommitdiffstats
path: root/cmd-parse.y
diff options
context:
space:
mode:
authornicm <nicm>2019-09-10 07:50:33 +0000
committernicm <nicm>2019-09-10 07:50:33 +0000
commit4b7e97ba533161e6130b957b91c9bb6aa3da7afa (patch)
tree2fa0b2ba0b04d18cf6d80055c7f68e8e3d3a5d9a /cmd-parse.y
parentb6b7486423fe5f1f3b1971308393088b03dc4dc8 (diff)
Set up format tree for %if, GitHub issue 1896.
Diffstat (limited to 'cmd-parse.y')
-rw-r--r--cmd-parse.y16
1 files changed, 8 insertions, 8 deletions
diff --git a/cmd-parse.y b/cmd-parse.y
index 6d2b970c..b0a42f7c 100644
--- a/cmd-parse.y
+++ b/cmd-parse.y
@@ -176,18 +176,18 @@ expanded : format
struct cmd_parse_input *pi = ps->input;
struct format_tree *ft;
struct client *c = pi->c;
- struct cmd_find_state *fs;
+ struct cmd_find_state *fsp;
+ struct cmd_find_state fs;
int flags = FORMAT_NOJOBS;
if (cmd_find_valid_state(&pi->fs))
- fs = &pi->fs;
- else
- fs = NULL;
+ fsp = &pi->fs;
+ else {
+ cmd_find_from_client(&fs, c, 0);
+ fsp = &fs;
+ }
ft = format_create(NULL, pi->item, FORMAT_NONE, flags);
- if (fs != NULL)
- format_defaults(ft, c, fs->s, fs->wl, fs->wp);
- else
- format_defaults(ft, c, NULL, NULL, NULL);
+ format_defaults(ft, c, fsp->s, fsp->wl, fsp->wp);
$$ = format_expand(ft, $1);
format_free(ft);