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:
@@ -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++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user