proper handling of empty dirs (hopefully)

This commit is contained in:
nova
2026-06-15 20:28:39 +02:00
parent 4def2c7cf0
commit c0299aef8c
4 changed files with 68 additions and 30 deletions
+6 -1
View File
@@ -82,10 +82,15 @@ char* smartstrcasestr(const char *haystack, const char *needle){
char* parse_cmd(const char *cmd, file *f){
char *out;
if (f == NULL) {
out = malloc(strlen(cmd)+1);
memcpy(out, cmd, strlen(cmd)+1);
return out;
}
const char *offset = strstr(cmd, SETTINGS_COMMAND_REPLACE_STR);
int count = 0;
char *out;
char *pos;
unsigned long i = 0;
while(f->file_name[i]) {