diff options
author | Nikias Bassen | 2013-07-18 16:21:02 +0200 |
---|---|---|
committer | Nikias Bassen | 2013-07-18 16:21:02 +0200 |
commit | 127f9d363fb59abb68104ae0386e891ecdfcf63f (patch) | |
tree | 5a88efb4dce0101411cdbc153672ba0632ef2e44 | |
parent | 47674f7256b2bd6da3fdc924f8f49a85a75e515c (diff) | |
download | ideviceinstaller-127f9d363fb59abb68104ae0386e891ecdfcf63f.tar.gz ideviceinstaller-127f9d363fb59abb68104ae0386e891ecdfcf63f.tar.bz2 |
move creation of PublicStaging directory to the top
-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: goto leave_cleanup; } + char **strs = NULL; + if (afc_get_file_info(afc, PKG_PATH, &strs) != AFC_E_SUCCESS) { + if (afc_make_directory(afc, PKG_PATH) != AFC_E_SUCCESS) { + fprintf(stderr, "WARNING: Could not create directory '%s' on device!\n", PKG_PATH); + } + } + if (strs) { + int i = 0; + while (strs[i]) { + free(strs[i]); + i++; + } + free(strs); + } + /* open install package */ int errp = 0; struct zip *zf = zip_open(appid, 0, &errp); @@ -831,21 +846,6 @@ run_again: printf("Copying '%s' --> '%s'\n", appid, pkgname); - char **strs = NULL; - if (afc_get_file_info(afc, PKG_PATH, &strs) != AFC_E_SUCCESS) { - if (afc_make_directory(afc, PKG_PATH) != AFC_E_SUCCESS) { - fprintf(stderr, "WARNING: Could not create directory '%s' on device!\n", PKG_PATH); - } - } - if (strs) { - int i = 0; - while (strs[i]) { - free(strs[i]); - i++; - } - free(strs); - } - if (afc_upload_file(afc, appid, pkgname) < 0) { free(pkgname); goto leave_cleanup; |