1
0
mirror of https://gittea.dev/nova/th.git synced 2025-10-21 10:20:15 -04:00

fixed infinite loop on copy/paste

This commit is contained in:
nova
2025-09-29 19:13:37 +02:00
parent d3e46846cd
commit 4784ec3f64

View File

@@ -747,11 +747,19 @@ void paste(){
mvprintw(i, 0, cmd);
if (system(cmd) != 0) {
cmd = concat(cmd, *yank_files.list);
char *line = NULL;
size_t size = 0;
FILE *cmd_open;
while (1) {
cmd = concat(cmd, "_");
if (system(cmd) == 0) {
cmd_open = popen(cmd, "r");
getline(&line, &size, cmd_open);
if (pclose(cmd_open) == 0) {
break;
} }
}
cmd = concat(cmd, "_");
}
}
yank_files.list++;
}