This commit is contained in:
overcuriousity 2025-09-05 15:50:21 +02:00
parent c5e920ef6c
commit 9caa2b57b7

View File

@ -923,12 +923,16 @@ void load_log_file(char* path) {
printf("INFO: Error-Logs werden in dieser Version nicht unterstützt.\n"); printf("INFO: Error-Logs werden in dieser Version nicht unterstützt.\n");
continue; continue;
} }
int path_len = strlen(path);
// Flag, um den Debug Print und den Export zu verbessern, ansonsten können // auftreten
int needs_slash = (path_len > 0 && path[path_len - 1] != '/');
if (is_log_file(filename)) { if (is_log_file(filename)) {
snprintf(full_path, sizeof(full_path), "%s/%s", path, filename); (needs_slash) ? snprintf(full_path, sizeof(full_path), "%s/%s", path, filename) : snprintf(full_path, sizeof(full_path), "%s%s", path, filename);
load_regular_file(full_path); load_regular_file(full_path);
files_found++; files_found++;
} else if (strstr(filename, ".gz") != NULL) { } else if (strstr(filename, ".gz") != NULL) {
snprintf(full_path, sizeof(full_path), "%s/%s", path, filename); (needs_slash) ? snprintf(full_path, sizeof(full_path), "%s/%s", path, filename) : snprintf(full_path, sizeof(full_path), "%s%s", path, filename);
load_gz_file(full_path); load_gz_file(full_path);
files_found++; files_found++;
} }
@ -1434,7 +1438,9 @@ void export_filtered_entries(char *filepath) {
fprintf(file, ","); fprintf(file, ",");
write_csv_field(file, all_entries[i].parsing_timestamp); write_csv_field(file, all_entries[i].parsing_timestamp);
fprintf(file, ","); fprintf(file, ",");
if (strlen(all_entries[i].annotation) > 0) {
write_csv_field(file, tag_str); write_csv_field(file, tag_str);
}
fprintf(file, "\n"); fprintf(file, "\n");
exported_count++; exported_count++;