From 044a5adfe085197530436f1873c66cf36ae906e6 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Sun, 5 Dec 2010 02:07:49 +0100 Subject: idevicebackup4: fix file type handling for DLContentsOfDirectory message --- tools/idevicebackup4.c | 10 +++++----- 1 file 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)); -- cgit v1.1-32-gdbae