diff options
author | 2021-05-25 03:08:32 +0200 | |
---|---|---|
committer | 2021-05-25 03:08:32 +0200 | |
commit | d0136024c69167a98343710fa6fcdc5843851006 (patch) | |
tree | 327631dc42f4596c19c0d8dd8c03bb9fda059df0 /tools | |
parent | 4b2f17e8cce8fa078aa55f5da5f726c20eac3e2e (diff) | |
download | libimobiledevice-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
Diffstat (limited to 'tools')
-rw-r--r-- | tools/idevicecrashreport.c | 8 |
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 | |||
148 | strcpy(((char*)source_filename) + device_directory_length, list[k]); | 148 | strcpy(((char*)source_filename) + device_directory_length, list[k]); |
149 | 149 | ||
150 | /* assemble absolute target filename */ | 150 | /* assemble absolute target filename */ |
151 | #ifdef WIN32 | ||
152 | /* replace every ':' with '-' since ':' is an illegal character for file names in windows */ | ||
153 | char* current_pos = strchr(list[k], ':'); | ||
154 | while (current_pos) { | ||
155 | *current_pos = '-'; | ||
156 | current_pos = strchr(current_pos, ':'); | ||
157 | } | ||
158 | #endif | ||
151 | char* p = strrchr(list[k], '.'); | 159 | char* p = strrchr(list[k], '.'); |
152 | if (p != NULL && !strncmp(p, ".synced", 7)) { | 160 | if (p != NULL && !strncmp(p, ".synced", 7)) { |
153 | /* make sure to strip ".synced" extension as seen on iOS 5 */ | 161 | /* make sure to strip ".synced" extension as seen on iOS 5 */ |