summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2010-01-25 15:43:10 +0100
committerGravatar Martin Szulecki2010-01-25 15:43:10 +0100
commit34a4e3e15cb30b1e786776695f96e5f0352b3c2e (patch)
treeb1e16ec2c2916d89ad71520919f1cc5d0fb95d14
parent33a7e44b20f44adafe663d11dc36f704b248f3f2 (diff)
downloadlibimobiledevice-34a4e3e15cb30b1e786776695f96e5f0352b3c2e.tar.gz
libimobiledevice-34a4e3e15cb30b1e786776695f96e5f0352b3c2e.tar.bz2
Do not append to .mdinfo files on backup. Write them only once.
-rw-r--r--tools/iphonebackup.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/tools/iphonebackup.c b/tools/iphonebackup.c
index 2628871..d444e9b 100644
--- a/tools/iphonebackup.c
+++ b/tools/iphonebackup.c
@@ -488,19 +488,19 @@ int main(int argc, char *argv[])
if (filename_source)
free(filename_source);
- }
- /* save <hash>.mdinfo */
- node = plist_dict_get_item(node_tmp, "BackupFileInfo");
- if (node) {
- node = plist_dict_get_item(node_tmp, "DLFileDest");
- plist_get_string_val(node, &file_path);
- file_ext = (char *)g_strconcat(file_path, ".mdinfo", NULL);
- filename_mdinfo = g_build_path(G_DIR_SEPARATOR_S, backup_directory, file_ext, NULL);
+ /* save <hash>.mdinfo */
node = plist_dict_get_item(node_tmp, "BackupFileInfo");
- plist_write_to_filename(node, filename_mdinfo, PLIST_FORMAT_BINARY);
- g_free(file_ext);
- g_free(filename_mdinfo);
+ if (node) {
+ node = plist_dict_get_item(node_tmp, "DLFileDest");
+ plist_get_string_val(node, &file_path);
+ file_ext = (char *)g_strconcat(file_path, ".mdinfo", NULL);
+ filename_mdinfo = g_build_path(G_DIR_SEPARATOR_S, backup_directory, file_ext, NULL);
+ node = plist_dict_get_item(node_tmp, "BackupFileInfo");
+ plist_write_to_filename(node, filename_mdinfo, PLIST_FORMAT_BINARY);
+ g_free(file_ext);
+ g_free(filename_mdinfo);
+ }
}
/* save <hash>.mddata */