diff options
| author | 2019-02-14 00:26:25 +0100 | |
|---|---|---|
| committer | 2019-02-14 00:26:25 +0100 | |
| commit | 64e88489ee47f4e5dca458970688485a0a165c30 (patch) | |
| tree | 6b54866538be3b62dd4e6b4896920c354787ce42 /src/common.c | |
| parent | fbaafdaf87cc01197ad86812a46cf17b7b392b8e (diff) | |
| download | idevicerestore-64e88489ee47f4e5dca458970688485a0a165c30.tar.gz idevicerestore-64e88489ee47f4e5dca458970688485a0a165c30.tar.bz2  | |
Allow .ipsw files or extracted IPSW as source
Diffstat (limited to 'src/common.c')
| -rw-r--r-- | src/common.c | 21 | 
1 files changed, 19 insertions, 2 deletions
diff --git a/src/common.c b/src/common.c index 559f342..d4b7c8d 100644 --- a/src/common.c +++ b/src/common.c @@ -2,8 +2,8 @@   * common.c   * Misc functions used in idevicerestore   * + * Copyright (c) 2012-2019 Nikias Bassen. All Rights Reserved.   * Copyright (c) 2012 Martin Szulecki. All Rights Reserved. - * Copyright (c) 2012 Nikias Bassen. All Rights Reserved.   * Copyright (c) 2010 Joshua Hill. All Rights Reserved.   *   * This library is free software; you can redistribute it and/or @@ -35,7 +35,6 @@  #include <sys/stat.h>  #include <fcntl.h>  #include <ctype.h> -#include <unistd.h>  #ifdef WIN32  #include <windows.h> @@ -486,6 +485,24 @@ char* strsep(char** strp, const char* delim)  }  #endif +#ifndef HAVE_REALPATH +char* realpath(const char *filename, char *resolved_name) +{ +#ifdef WIN32 +	if (access(filename, F_OK) != 0) { +		return NULL; +	} +	if (GetFullPathName(filename, MAX_PATH, resolved_name, NULL) == 0) { +		return NULL; +	} +	return resolved_name; +#else +#error please provide a realpath implementation for this platform +	return NULL; +#endif +} +#endif +  #ifdef WIN32  #define BS_CC '\b'  #define my_getch getch  | 
