diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-05-15 13:12:49 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-05-15 13:12:49 +0200 |
| commit | 4351318472c846cabaa42433f32ea44d6a41c8d6 (patch) | |
| tree | 7a06606a2791e9fe38eed74f5738e60c9034d280 /sam.c | |
| parent | 9d216fdaca5c89fdce1308cc1b2b2ed2f7fdee11 (diff) | |
| download | vis-4351318472c846cabaa42433f32ea44d6a41c8d6.tar.gz vis-4351318472c846cabaa42433f32ea44d6a41c8d6.tar.xz | |
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
Diffstat (limited to 'sam.c')
| -rw-r--r-- | sam.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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; } |
