Fixed loading of zipped roms from the command line in the Linux version
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
#include <utime.h>
|
#include <utime.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
@@ -300,7 +301,20 @@ int do_extract(unzFile uf,int opt_extract_without_path,int opt_overwrite)
|
|||||||
void extractzip(char *FileToExtract)
|
void extractzip(char *FileToExtract)
|
||||||
{
|
{
|
||||||
unzFile uf=NULL;
|
unzFile uf=NULL;
|
||||||
|
// I really don't like hardcoding these sizes...
|
||||||
|
char oldpath[128];
|
||||||
|
|
||||||
|
#ifdef __LINUX__
|
||||||
|
extern char InitDir;
|
||||||
|
|
||||||
|
getcwd(oldpath, 128);
|
||||||
|
chdir(&InitDir);
|
||||||
|
#endif
|
||||||
uf = unzOpen(FileToExtract);
|
uf = unzOpen(FileToExtract);
|
||||||
|
#ifdef __LINUX__
|
||||||
|
chdir(oldpath);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (uf==NULL)
|
if (uf==NULL)
|
||||||
{
|
{
|
||||||
ZipError=1;
|
ZipError=1;
|
||||||
|
|||||||
Reference in New Issue
Block a user