Skip to content

Commit

Permalink
sam: fix small oversight in cmd_filter
Browse files Browse the repository at this point in the history
This was the only place where buffer_move was actaully doing something useful.
  • Loading branch information
rnpnr committed Jan 12, 2025
1 parent f2b2337 commit fae3782
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sam.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit fae3782

Please sign in to comment.