include unistd.h for chdir()
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3758 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
01defffbf5
commit
a213c56d8e
1 changed files with 4 additions and 5 deletions
|
@ -11,11 +11,14 @@
|
||||||
#include "exehead/resource.h"
|
#include "exehead/resource.h"
|
||||||
#include <cassert> // for assert(3)
|
#include <cassert> // for assert(3)
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifdef _WIN32
|
||||||
|
# include <direct.h>
|
||||||
|
#else
|
||||||
# include <sys/stat.h>
|
# include <sys/stat.h>
|
||||||
# include <time.h>
|
# include <time.h>
|
||||||
# include <glob.h>
|
# include <glob.h>
|
||||||
# include <fcntl.h> // for O_RDONLY
|
# include <fcntl.h> // for O_RDONLY
|
||||||
|
# include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MAX_INCLUDEDEPTH 10
|
#define MAX_INCLUDEDEPTH 10
|
||||||
|
@ -2711,11 +2714,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
||||||
}
|
}
|
||||||
return PS_OK;
|
return PS_OK;
|
||||||
case TOK_P_CD:
|
case TOK_P_CD:
|
||||||
#ifdef _WIN32
|
|
||||||
if (!line.gettoken_str(1)[0] || !SetCurrentDirectory(line.gettoken_str(1)))
|
|
||||||
#else
|
|
||||||
if (!line.gettoken_str(1)[0] || chdir(line.gettoken_str(1)))
|
if (!line.gettoken_str(1)[0] || chdir(line.gettoken_str(1)))
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
ERROR_MSG("!cd: error changing to: \"%s\"\n",line.gettoken_str(1));
|
ERROR_MSG("!cd: error changing to: \"%s\"\n",line.gettoken_str(1));
|
||||||
return PS_ERROR;
|
return PS_ERROR;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue