summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2010-12-05 02:07:49 +0100
committerGravatar Martin Szulecki2011-04-11 19:42:19 +0200
commit044a5adfe085197530436f1873c66cf36ae906e6 (patch)
treeccfe43894af23e21cddd20e540f2c39baaeb239f
parentaae3469d1b6cc825c046a2fb0e9fa06c8eb945ca (diff)
downloadlibimobiledevice-044a5adfe085197530436f1873c66cf36ae906e6.tar.gz
libimobiledevice-044a5adfe085197530436f1873c66cf36ae906e6.tar.bz2
idevicebackup4: fix file type handling for DLContentsOfDirectory message
-rw-r--r--tools/idevicebackup4.c10
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)
plist_get_string_val(node, &str);
}
if (!str) {
- printf("ERROR: Malformed DLContentsOfDirectoryMessage\n");
+ printf("ERROR: Malformed DLContentsOfDirectory message\n");
// TODO error handling
return;
}
@@ -1151,13 +1151,13 @@ static void handle_list_directory(plist_t message, const char *backup_dir)
plist_t fdict = plist_new_dict();
GStatBuf st;
g_stat(fpath, &st);
+ const char *ftype = "DLFileTypeUnknown";
if (g_file_test(fpath, G_FILE_TEST_IS_DIR)) {
- plist_dict_insert_item(fdict, "DLFileType", plist_new_string("DLFileTypeDirectory"));
+ ftype = "DLFileTypeDirectory";
} else if (g_file_test(fpath, G_FILE_TEST_IS_REGULAR)) {
- plist_dict_insert_item(fdict, "DLFileType", plist_new_string("DLFileTypeRegular"));
- } else {
- printf("%s: TODO implement other file types\n", __func__);
+ ftype = "DLFileTypeRegular";
}
+ plist_dict_insert_item(fdict, "DLFileType", plist_new_string(ftype));
plist_dict_insert_item(fdict, "DLFileSize", plist_new_uint(st.st_size));
plist_dict_insert_item(fdict, "DLFileModificationDate", plist_new_date(st.st_mtime, 0));