diff options
| author | Randy Palamar <randy@rnpnr.xyz> | 2025-01-12 08:09:34 -0700 |
|---|---|---|
| committer | Randy Palamar <randy@rnpnr.xyz> | 2025-01-12 08:09:34 -0700 |
| commit | fae3782e298bad30583e2e9b4888926732636de4 (patch) | |
| tree | d38c35e8a4d8772075160e4e3fa9b30d3c974ba7 /sam.c | |
| parent | f2b2337a31c8e9e89085ed9d123d743e976ba85b (diff) | |
| download | vis-fae3782e298bad30583e2e9b4888926732636de4.tar.gz vis-fae3782e298bad30583e2e9b4888926732636de4.tar.xz | |
sam: fix small oversight in cmd_filter
This was the only place where buffer_move was actaully doing something useful.
Diffstat (limited to 'sam.c')
| -rw-r--r-- | sam.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1745,10 +1745,10 @@ static bool cmd_filter(Vis *vis, Win *win, Command *cmd, const char *argv[], Sel if (vis->interrupted) { vis_info_show(vis, "Command cancelled"); } else if (status == 0) { - if (!sam_change(win, sel, range, bufout.data, bufout.len, 1)) { - free(bufout.data); - bufout.data = 0; - } + char *data = bufout.data; + bufout.data = 0; + if (!sam_change(win, sel, range, data, bufout.len, 1)) + free(data); } else { vis_info_show(vis, "Command failed %s", buffer_content0(&buferr)); } |
