From d0136024c69167a98343710fa6fcdc5843851006 Mon Sep 17 00:00:00 2001 From: zecops-team Date: Tue, 25 May 2021 03:08:32 +0200 Subject: tools/idevicecrashreport: Fix illegal filenames on Windows Replace every ':' with '-' since ':' is an illegal character for file names on Windows --- tools/idevicecrashreport.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/idevicecrashreport.c b/tools/idevicecrashreport.c index 2945111..0a03c68 100644 --- a/tools/idevicecrashreport.c +++ b/tools/idevicecrashreport.c @@ -148,6 +148,14 @@ static int afc_client_copy_and_remove_crash_reports(afc_client_t afc, const char strcpy(((char*)source_filename) + device_directory_length, list[k]); /* assemble absolute target filename */ +#ifdef WIN32 + /* replace every ':' with '-' since ':' is an illegal character for file names in windows */ + char* current_pos = strchr(list[k], ':'); + while (current_pos) { + *current_pos = '-'; + current_pos = strchr(current_pos, ':'); + } +#endif char* p = strrchr(list[k], '.'); if (p != NULL && !strncmp(p, ".synced", 7)) { /* make sure to strip ".synced" extension as seen on iOS 5 */ -- cgit v1.1-32-gdbae