diff options
| -rw-r--r-- | src/ideviceinstaller.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/ideviceinstaller.c b/src/ideviceinstaller.c index 2d07a03..a99df2c 100644 --- a/src/ideviceinstaller.c +++ b/src/ideviceinstaller.c | |||
| @@ -637,6 +637,21 @@ run_again: | |||
| 637 | goto leave_cleanup; | 637 | goto leave_cleanup; |
| 638 | } | 638 | } |
| 639 | 639 | ||
| 640 | char **strs = NULL; | ||
| 641 | if (afc_get_file_info(afc, PKG_PATH, &strs) != AFC_E_SUCCESS) { | ||
| 642 | if (afc_make_directory(afc, PKG_PATH) != AFC_E_SUCCESS) { | ||
| 643 | fprintf(stderr, "WARNING: Could not create directory '%s' on device!\n", PKG_PATH); | ||
| 644 | } | ||
| 645 | } | ||
| 646 | if (strs) { | ||
| 647 | int i = 0; | ||
| 648 | while (strs[i]) { | ||
| 649 | free(strs[i]); | ||
| 650 | i++; | ||
| 651 | } | ||
| 652 | free(strs); | ||
| 653 | } | ||
| 654 | |||
| 640 | /* open install package */ | 655 | /* open install package */ |
| 641 | int errp = 0; | 656 | int errp = 0; |
| 642 | struct zip *zf = zip_open(appid, 0, &errp); | 657 | struct zip *zf = zip_open(appid, 0, &errp); |
| @@ -831,21 +846,6 @@ run_again: | |||
| 831 | 846 | ||
| 832 | printf("Copying '%s' --> '%s'\n", appid, pkgname); | 847 | printf("Copying '%s' --> '%s'\n", appid, pkgname); |
| 833 | 848 | ||
| 834 | char **strs = NULL; | ||
| 835 | if (afc_get_file_info(afc, PKG_PATH, &strs) != AFC_E_SUCCESS) { | ||
| 836 | if (afc_make_directory(afc, PKG_PATH) != AFC_E_SUCCESS) { | ||
| 837 | fprintf(stderr, "WARNING: Could not create directory '%s' on device!\n", PKG_PATH); | ||
| 838 | } | ||
| 839 | } | ||
| 840 | if (strs) { | ||
| 841 | int i = 0; | ||
| 842 | while (strs[i]) { | ||
| 843 | free(strs[i]); | ||
| 844 | i++; | ||
| 845 | } | ||
| 846 | free(strs); | ||
| 847 | } | ||
| 848 | |||
| 849 | if (afc_upload_file(afc, appid, pkgname) < 0) { | 849 | if (afc_upload_file(afc, appid, pkgname) < 0) { |
| 850 | free(pkgname); | 850 | free(pkgname); |
| 851 | goto leave_cleanup; | 851 | goto leave_cleanup; |
