Remove file from marked after remove

This commit is contained in:
Night Kaly 2024-10-11 20:03:31 +01:00
parent 3e95b7ab9c
commit 42751778ac
Signed by: night0721
GPG key ID: 957D67B8DB7A119B
2 changed files with 5 additions and 1 deletions

3
ccc.c
View file

@ -1075,6 +1075,9 @@ void delete_files()
change_dir(cwd, 0, 0);
}
}
for (int i = 0; i < marked->length; i++) {
arraylist_remove(marked, 0);
}
} else {
wpprintw("TODO: implement hard delete");
}

3
file.c
View file

@ -60,12 +60,13 @@ void arraylist_remove(ArrayList *list, long index)
if (index >= list->length)
return;
/* marked stuff doesn't work with this
free(list->items[index].name);
free(list->items[index].path);
free(list->items[index].type);
free(list->items[index].stats);
free(list->items[index].icon);
*/
for (long i = index; i < list->length - 1; i++)
list->items[i] = list->items[i + 1];