aboutsummaryrefslogtreecommitdiff
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
parentc970823c93ff7478877d7df9c66b5032e744dc19 (diff)
downloadvcxsrv-0235891665ad311e1f81d1b0f003f433b4af4cbb.tar.gz
vcxsrv-0235891665ad311e1f81d1b0f003f433b4af4cbb.tar.bz2
vcxsrv-0235891665ad311e1f81d1b0f003f433b4af4cbb.zip
Solved problem when path environment variable was larger then 1024 bytes
-rw-r--r--tools/mhmake/src/build.cpp8
-rw-r--r--tools/mhmake/src/mhmakefileparser.h2
-rw-r--r--tools/mhmake/src/util.h2
3 files changed, 6 insertions, 6 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 */
diff --git a/tools/mhmake/src/mhmakefileparser.h b/tools/mhmake/src/mhmakefileparser.h
index 43bcad538..b37e96466 100644
--- a/tools/mhmake/src/mhmakefileparser.h
+++ b/tools/mhmake/src/mhmakefileparser.h
@@ -355,7 +355,7 @@ public:
mh_pid_t EchoCommand(const string &Params) const;
string SearchCommand(const string &Command, const string &Extension="") const;
const string &GetPythonExe() const;
- int SearchPath(void *NotUsed, const char *szCommand, const char *pExt, int Len, char *szFullCommand,char **pFilePart) const;
+ int SearchPath(const char *szCommand, const char *pExt, int Len, char *szFullCommand,char **pFilePart) const;
mh_pid_t OsExeCommand(const string &Command, const string &Params, bool IgnoreError, string *pOutput) const;
};
diff --git a/tools/mhmake/src/util.h b/tools/mhmake/src/util.h
index 9e5948448..9deb700c7 100644
--- a/tools/mhmake/src/util.h
+++ b/tools/mhmake/src/util.h
@@ -50,7 +50,7 @@
#define PLATFORM "linux"
#endif
-#define MHMAKEVER "2.0.1"
+#define MHMAKEVER "2.0.2"
class makecommand
{