diff options
| author | 2010-12-05 02:07:49 +0100 | |
|---|---|---|
| committer | 2011-04-11 19:42:19 +0200 | |
| commit | 044a5adfe085197530436f1873c66cf36ae906e6 (patch) | |
| tree | ccfe43894af23e21cddd20e540f2c39baaeb239f | |
| parent | aae3469d1b6cc825c046a2fb0e9fa06c8eb945ca (diff) | |
| download | libimobiledevice-044a5adfe085197530436f1873c66cf36ae906e6.tar.gz libimobiledevice-044a5adfe085197530436f1873c66cf36ae906e6.tar.bz2 | |
idevicebackup4: fix file type handling for DLContentsOfDirectory message
| -rw-r--r-- | tools/idevicebackup4.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/idevicebackup4.c b/tools/idevicebackup4.c index 4ebe34b..cc9499b 100644 --- a/tools/idevicebackup4.c +++ b/tools/idevicebackup4.c | |||
| @@ -1132,7 +1132,7 @@ static void handle_list_directory(plist_t message, const char *backup_dir) | |||
| 1132 | plist_get_string_val(node, &str); | 1132 | plist_get_string_val(node, &str); |
| 1133 | } | 1133 | } |
| 1134 | if (!str) { | 1134 | if (!str) { |
| 1135 | printf("ERROR: Malformed DLContentsOfDirectoryMessage\n"); | 1135 | printf("ERROR: Malformed DLContentsOfDirectory message\n"); |
| 1136 | // TODO error handling | 1136 | // TODO error handling |
| 1137 | return; | 1137 | return; |
| 1138 | } | 1138 | } |
| @@ -1151,13 +1151,13 @@ static void handle_list_directory(plist_t message, const char *backup_dir) | |||
| 1151 | plist_t fdict = plist_new_dict(); | 1151 | plist_t fdict = plist_new_dict(); |
| 1152 | GStatBuf st; | 1152 | GStatBuf st; |
| 1153 | g_stat(fpath, &st); | 1153 | g_stat(fpath, &st); |
| 1154 | const char *ftype = "DLFileTypeUnknown"; | ||
| 1154 | if (g_file_test(fpath, G_FILE_TEST_IS_DIR)) { | 1155 | if (g_file_test(fpath, G_FILE_TEST_IS_DIR)) { |
| 1155 | plist_dict_insert_item(fdict, "DLFileType", plist_new_string("DLFileTypeDirectory")); | 1156 | ftype = "DLFileTypeDirectory"; |
| 1156 | } else if (g_file_test(fpath, G_FILE_TEST_IS_REGULAR)) { | 1157 | } else if (g_file_test(fpath, G_FILE_TEST_IS_REGULAR)) { |
| 1157 | plist_dict_insert_item(fdict, "DLFileType", plist_new_string("DLFileTypeRegular")); | 1158 | ftype = "DLFileTypeRegular"; |
| 1158 | } else { | ||
| 1159 | printf("%s: TODO implement other file types\n", __func__); | ||
| 1160 | } | 1159 | } |
| 1160 | plist_dict_insert_item(fdict, "DLFileType", plist_new_string(ftype)); | ||
| 1161 | plist_dict_insert_item(fdict, "DLFileSize", plist_new_uint(st.st_size)); | 1161 | plist_dict_insert_item(fdict, "DLFileSize", plist_new_uint(st.st_size)); |
| 1162 | plist_dict_insert_item(fdict, "DLFileModificationDate", plist_new_date(st.st_mtime, 0)); | 1162 | plist_dict_insert_item(fdict, "DLFileModificationDate", plist_new_date(st.st_mtime, 0)); |
| 1163 | 1163 | ||
