Correct read_dir nlink/blocks reporting (#540)
When requested via "--list --json" read_dir(...) loops thru AFCKeyValueRead(...) to obtain st_size/st_mtime/st_birthtime/st_nlink/st_blocks of each directory entry. Likely typo had st_nlink value being overwritten by st_blocks value causing reported "st_nlink" to match st_blocks and st_blocks always be "-1". Fix corrects this small typo and now both values are being reported correctly in this case.
diff --git a/src/ios-deploy/ios-deploy.m b/src/ios-deploy/ios-deploy.m
index 72e9808..f762e24 100644
--- a/src/ios-deploy/ios-deploy.m
+++ b/src/ios-deploy/ios-deploy.m
@@ -1563,7 +1563,7 @@
} else if (strcmp(key, "st_nlink") == 0) {
nlink = atol(val);
} else if (strcmp(key, "st_blocks") == 0) {
- nlink = atol(val);
+ blocks = atol(val);
}
}
AFCKeyValueClose(afc_dict_p);