1
0
mirror of https://gittea.dev/nova/th.git synced 2025-10-22 02:40: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); mvprintw(i, 0, cmd);
if (system(cmd) != 0) { if (system(cmd) != 0) {
cmd = concat(cmd, *yank_files.list); cmd = concat(cmd, *yank_files.list);
char *line = NULL;
size_t size = 0;
FILE *cmd_open;
while (1) { while (1) {
cmd = concat(cmd, "_"); cmd_open = popen(cmd, "r");
if (system(cmd) == 0) { getline(&line, &size, cmd_open);
if (pclose(cmd_open) == 0) {
break; break;
} } }
cmd = concat(cmd, "_");
}
} }
yank_files.list++; yank_files.list++;
} }