Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Unified Diff: examples/filetree.c

Issue 2364793002: Revert "Uprev libmtp to 1.1.12" (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libmtp@master
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « examples/files.c ('k') | examples/folders.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/filetree.c
diff --git a/examples/filetree.c b/examples/filetree.c
index 234d09321b90ca67a642eef285d213beb50ba56f..6d6ed81905ff74fc15e3045c73ff8f38d2456c31 100644
--- a/examples/filetree.c
+++ b/examples/filetree.c
@@ -49,10 +49,8 @@ void recursive_file_tree(LIBMTP_mtpdevice_t *device,
}
/* Iterate over the filelisting */
- file = files;
- while (file != NULL) {
+ for (file = files; file != NULL; file = file->next) {
int i;
- LIBMTP_file_t *oldfile;
/* Indent */
for (i = 0; i < depth; i++) {
@@ -62,10 +60,6 @@ void recursive_file_tree(LIBMTP_mtpdevice_t *device,
if (file->filetype == LIBMTP_FILETYPE_FOLDER) {
recursive_file_tree(device, storage, file->item_id, depth+2);
}
-
- oldfile = file;
- file = file->next;
- LIBMTP_destroy_file_t(oldfile);
}
}
« no previous file with comments | « examples/files.c ('k') | examples/folders.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698