From 24462e8192a365deb826dc542c200caa7c4a67f5 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 2 Dec 2013 19:23:19 +0100 Subject: respect --cache-path when using --latest --- src/idevicerestore.c | 2 +- src/ipsw.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/idevicerestore.c b/src/idevicerestore.c index f89f772..ef547eb 100644 --- a/src/idevicerestore.c +++ b/src/idevicerestore.c @@ -307,7 +307,7 @@ int idevicerestore_start(struct idevicerestore_client_t* client) if (client->flags & FLAG_LATEST) { char* ipsw = NULL; - int res = ipsw_download_latest_fw(client->version_data, client->device->product_type, "cache", &ipsw); + int res = ipsw_download_latest_fw(client->version_data, client->device->product_type, client->cache_dir, &ipsw); if (res != 0) { if (ipsw) { free(ipsw); diff --git a/src/ipsw.c b/src/ipsw.c index 101c28a..9f24784 100644 --- a/src/ipsw.c +++ b/src/ipsw.c @@ -435,7 +435,11 @@ int ipsw_download_latest_fw(plist_t version_data, const char* product, const cha info("Latest firmware is %s\n", fwfn); char fwlfn[256]; - sprintf(fwlfn, "%s/%s", todir, fwfn); + if (todir) { + sprintf(fwlfn, "%s/%s", todir, fwfn); + } else { + sprintf(fwlfn, "%s", fwfn); + } char fwlock[256]; sprintf(fwlock, "%s.lock", fwlfn); -- cgit v1.1-32-gdbae