summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-07-28 18:14:08 +0200
committerGravatar Nikias Bassen2012-07-28 18:14:08 +0200
commitc6110de59aa435d26ae93078c88c45215e1e8056 (patch)
tree02b398572c7af07b022137a9646bd0772319b014
parentd85f12afd6fd31963ddc67748264bd23116a11bd (diff)
downloadidevicerestore-c6110de59aa435d26ae93078c88c45215e1e8056.tar.gz
idevicerestore-c6110de59aa435d26ae93078c88c45215e1e8056.tar.bz2
main: use client flag instead of local variable for --latest option
-rw-r--r--src/common.h1
-rw-r--r--src/idevicerestore.c9
2 files changed, 5 insertions, 5 deletions
diff --git a/src/common.h b/src/common.h
index bff5f1e..3f7d20e 100644
--- a/src/common.h
+++ b/src/common.h
@@ -48,6 +48,7 @@ extern "C" {
#define FLAG_PWN 32
#define FLAG_NOACTION 64
#define FLAG_SHSHONLY 128
+#define FLAG_LATEST 256
struct dfu_client_t;
struct normal_client_t;
diff --git a/src/idevicerestore.c b/src/idevicerestore.c
index a1875d4..059ae08 100644
--- a/src/idevicerestore.c
+++ b/src/idevicerestore.c
@@ -159,7 +159,6 @@ int main(int argc, char* argv[]) {
char* ipsw = NULL;
char* udid = NULL;
int tss_enabled = 0;
- int latest = 0;
int result = 0;
// create an instance of our context
@@ -198,7 +197,7 @@ int main(int argc, char* argv[]) {
break;
case 'l':
- latest = 1;
+ client->flags |= FLAG_LATEST;
break;
case 'i':
@@ -241,7 +240,7 @@ int main(int argc, char* argv[]) {
}
}
- if (((argc-optind) == 1) || (client->flags & FLAG_PWN) || (latest)) {
+ if (((argc-optind) == 1) || (client->flags & FLAG_PWN) || (client->flags & FLAG_LATEST)) {
argc -= optind;
argv += optind;
@@ -251,7 +250,7 @@ int main(int argc, char* argv[]) {
return -1;
}
- if (latest) {
+ if (client->flags & FLAG_LATEST) {
if (client->flags & FLAG_CUSTOM) {
error("ERROR: You can't use --custom and --latest options at the same time.\n");
return -1;
@@ -374,7 +373,7 @@ int main(int argc, char* argv[]) {
return 0;
}
- if (latest) {
+ if (client->flags & FLAG_LATEST) {
int res = ipsw_download_latest_fw(client->version_data, client->device->product, "cache", &ipsw);
if (res != 0) {
return res;