diff options
-rw-r--r-- | tools/idevicebackup2.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c index 30e3724..2c77e1f 100644 --- a/tools/idevicebackup2.c +++ b/tools/idevicebackup2.c @@ -1004,6 +1004,9 @@ static void mb2_handle_list_directory(plist_t message, const char *backup_dir) if (cur_dir) { struct dirent* ep; while ((ep = readdir(cur_dir))) { + if ((strcmp(ep->d_name, ".") == 0) || (strcmp(ep->d_name, "..") == 0)) { + continue; + } char *fpath = build_path(path, ep->d_name, NULL); if (fpath) { plist_t fdict = plist_new_dict(); @@ -1122,6 +1125,9 @@ static void mb2_copy_directory_by_path(const char *src, const char *dst) if (cur_dir) { struct dirent* ep; while ((ep = readdir(cur_dir))) { + if ((strcmp(ep->d_name, ".") == 0) || (strcmp(ep->d_name, "..") == 0)) { + continue; + } char *srcpath = build_path(src, ep->d_name, NULL); char *dstpath = build_path(dst, ep->d_name, NULL); if (srcpath && dstpath) { |