Closed emanuele6 closed 8 months ago
This should be fixed by:
diff --git a/sam.c b/sam.c
index 9902a66..afd1233 100644
--- a/sam.c
+++ b/sam.c
@@ -1414,6 +1412,9 @@ static int extract(Vis *vis, Win *win, Command *cmd, const char *argv[], Selecti
int count = 0;
Text *txt = win->file->text;
+ if (!text_range_valid(range))
+ return 0;
+
if (cmd->regex) {
size_t start = range->start, end = range->end;
size_t last_start = argv[0][0] == 'x' ? EPOS : start;
But I will need some time to verify if this is the correct place for the fix.
vis
ihello<esc>
:2x/foo/
vis
gets stuck in an infinite loop and you have to SIGKILL it to make it stopgdb
backtrace (top frames could be different depending on when you press^C
):