aboutsummaryrefslogtreecommitdiff
path: root/tools/mhmake/src/build.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-02-25 11:16:55 +0000
committermarha <marha@users.sourceforge.net>2010-02-25 11:16:55 +0000
commit0235891665ad311e1f81d1b0f003f433b4af4cbb (patch)
tree26f78cd64df8bbedddf70b62ee06550dd7b6c0b9 /tools/mhmake/src/build.cpp
parentc970823c93ff7478877d7df9c66b5032e744dc19 (diff)
downloadvcxsrv-0235891665ad311e1f81d1b0f003f433b4af4cbb.tar.gz
vcxsrv-0235891665ad311e1f81d1b0f003f433b4af4cbb.tar.bz2
vcxsrv-0235891665ad311e1f81d1b0f003f433b4af4cbb.zip
Solved problem when path environment variable was larger then 1024 bytes
Diffstat (limited to 'tools/mhmake/src/build.cpp')
-rw-r--r--tools/mhmake/src/build.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/mhmake/src/build.cpp b/tools/mhmake/src/build.cpp
index 064ffe6c9..57cd94b79 100644
--- a/tools/mhmake/src/build.cpp
+++ b/tools/mhmake/src/build.cpp
@@ -240,7 +240,7 @@ void mhmakefileparser::CreatePythonExe(const string &FullCommand)
#endif
/*****************************************************************************/
-int mhmakefileparser::SearchPath(void *NotUsed, const char *szCommand, const char *pExt, int Len, char *szFullCommand,char **pFilePart) const
+int mhmakefileparser::SearchPath(const char *szCommand, const char *pExt, int Len, char *szFullCommand,char **pFilePart) const
{
static vector< refptr<fileinfo> > vSearchPath;
@@ -258,17 +258,17 @@ int mhmakefileparser::SearchPath(void *NotUsed, const char *szCommand, const cha
CommandFile->InvalidateDate(); // It could be created in the makefile later
if (!vSearchPath.size())
{
- char Path[1024];
char *pPath=getenv(PATH);
if (!pPath)
return 0;
- strcpy(Path,pPath); // To be able to use strtok
+ char *Path=strdup(pPath); // To be able to use strtok
char *pTok=strtok(Path,OSPATHENVSEPSTR);
while (pTok)
{
vSearchPath.push_back(GetFileInfo(pTok,m_MakeDir));
pTok=strtok(NULL,OSPATHENVSEPSTR);
}
+ free(Path);
}
It=vSearchPath.begin();
ItEnd=vSearchPath.end();
@@ -303,7 +303,7 @@ string mhmakefileparser::SearchCommand(const string &Command, const string &Exte
pExt=NULL;
else
pExt=Extension.c_str();
- if (SearchPath(NULL,UnquoteFileName(Command).c_str(),pExt,MAX_PATH,FullCommand,NULL))
+ if (SearchPath(UnquoteFileName(Command).c_str(),pExt,MAX_PATH,FullCommand,NULL))
return FullCommand;
#ifdef WIN32
/* See if we have a path for python.exe in the registry */