summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2010-01-25 02:55:16 +0100
committerGravatar Martin Szulecki2010-01-25 02:55:16 +0100
commit736d600aa7ea50dc79201be8b35c7e6767f12a6d (patch)
tree34bf2044affda0a4a1461dbb4e71a225dcbd21f7
parentd6cbfafa5372557d41bb4f97eb3f8e33ee92fa8e (diff)
downloadlibimobiledevice-736d600aa7ea50dc79201be8b35c7e6767f12a6d.tar.gz
libimobiledevice-736d600aa7ea50dc79201be8b35c7e6767f12a6d.tar.bz2
Make sure to print accurate backup progress information; was wrong so far
-rw-r--r--tools/iphonebackup.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/tools/iphonebackup.c b/tools/iphonebackup.c
index f7be8ca..28a8949 100644
--- a/tools/iphonebackup.c
+++ b/tools/iphonebackup.c
@@ -464,14 +464,15 @@ int main(int argc, char *argv[])
is_manifest = FALSE;
if (c == 2) {
- node = plist_dict_get_item(node_tmp, "DLFileAttributesKey");
- node = plist_dict_get_item(node, "FileSize");
- plist_get_uint_val(node, &length);
-
/* increased received size for each completed file */
- backup_real_size += length;
-
if (!is_manifest) {
+ node = plist_dict_get_item(node_tmp, "DLFileAttributesKey");
+ node = plist_dict_get_item(node, "FileSize");
+ plist_get_uint_val(node, &length);
+
+ backup_real_size += length;
+ file_index++;
+
format_size = g_format_size_for_display(backup_real_size);
printf("(%s", format_size);
g_free(format_size);
@@ -543,8 +544,6 @@ int main(int argc, char *argv[])
plist_free(message);
message = NULL;
-
- file_index++;
} while (!plist_strcmp(node, "DLSendFile"));
printf("Received %d files from device.\n", file_index);