From 4351318472c846cabaa42433f32ea44d6a41c8d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Mon, 15 May 2017 13:12:49 +0200 Subject: sam: use default address for file looping commands This sould fix a clang analyzer warning and make the code more robust. The problem could actually not occur in practice because the X and Y commands always have the internal cmd_select as intermediate node in the execution tree. In general the multiple file support will need more design work. Fix #551 --- sam.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sam.c') diff --git a/sam.c b/sam.c index c25bf4f..19894bf 100644 --- a/sam.c +++ b/sam.c @@ -1519,8 +1519,10 @@ static bool cmd_files(Vis *vis, Win *win, Command *cmd, const char *argv[], Curs continue; bool match = !cmd->regex || (win->file->name && text_regex_match(cmd->regex, win->file->name, 0)); - if (match ^ (argv[0][0] == 'Y')) - ret &= sam_execute(vis, win, cmd->cmd, NULL, NULL); + if (match ^ (argv[0][0] == 'Y')) { + Filerange def = text_range_new(0, 0); + ret &= sam_execute(vis, win, cmd->cmd, NULL, &def); + } } return ret; } -- cgit v1.2.3