summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar zecops-team2021-05-25 03:08:32 +0200
committerGravatar Nikias Bassen2021-05-25 03:08:32 +0200
commitd0136024c69167a98343710fa6fcdc5843851006 (patch)
tree327631dc42f4596c19c0d8dd8c03bb9fda059df0
parent4b2f17e8cce8fa078aa55f5da5f726c20eac3e2e (diff)
downloadlibimobiledevice-d0136024c69167a98343710fa6fcdc5843851006.tar.gz
libimobiledevice-d0136024c69167a98343710fa6fcdc5843851006.tar.bz2
tools/idevicecrashreport: Fix illegal filenames on Windows
Replace every ':' with '-' since ':' is an illegal character for file names on Windows
-rw-r--r--tools/idevicecrashreport.c8
1 files changed, 8 insertions, 0 deletions
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 */