diff options
author | marha <marha@users.sourceforge.net> | 2009-09-18 14:46:17 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-09-18 14:46:17 +0000 |
commit | 58b69e7eb9be29c60e45d46a880b391e3809e76f (patch) | |
tree | 52d02c01fdb64f357275388722df0007f1b2d787 /tools/mhmake/src/util.h | |
parent | 6addc90b0516c3cda5cb6c8f9b6918b356db4449 (diff) | |
download | vcxsrv-58b69e7eb9be29c60e45d46a880b391e3809e76f.tar.gz vcxsrv-58b69e7eb9be29c60e45d46a880b391e3809e76f.tar.bz2 vcxsrv-58b69e7eb9be29c60e45d46a880b391e3809e76f.zip |
Changes for making it possible to have spaces in the MHMAKECONF environment variable.
Diffstat (limited to 'tools/mhmake/src/util.h')
-rw-r--r-- | tools/mhmake/src/util.h | 70 |
1 files changed, 40 insertions, 30 deletions
diff --git a/tools/mhmake/src/util.h b/tools/mhmake/src/util.h index 6d660fc94..5cd242d51 100644 --- a/tools/mhmake/src/util.h +++ b/tools/mhmake/src/util.h @@ -50,7 +50,7 @@ #define PLATFORM "linux"
#endif
-#define MHMAKEVER "1.3.22"
+#define MHMAKEVER "1.4.0"
#define MAKEDEPFILE ".makefile.dep"
@@ -73,39 +73,49 @@ inline const char *NextItem(const char *pTmp,string &Output, const char *pToks=" const char *pStart;
const char *pStop;
while (strchr(pToks,*pTmp)&&*pTmp) pTmp++;
- if (*pTmp=='"')
+ pStart=pTmp;
+ while (1)
{
- pStart=pTmp++;
- while (*pTmp && *pTmp!='"') pTmp++;
- if (*pTmp) pTmp++;
- pStop=pTmp;
- }
- else if (*pTmp=='\'')
- {
- pStart=pTmp++;
- while (*pTmp && *pTmp!='\'') pTmp++;
- if (*pTmp) pTmp++;
- pStop=pTmp;
- }
- else if (!*pTmp)
- {
- pStart=pStop=pTmp;
- }
- else
- {
- pStart=pTmp++;
- #if OSPATHSEP=='/'
- while (*pTmp)
+ if (*pTmp=='"')
+ {
+ pTmp++;
+ while (*pTmp && *pTmp!='"') pTmp++;
+ if (*pTmp) pTmp++;
+ pStop=pTmp;
+ if (!*pTmp || strchr(pToks,*pTmp))
+ break;
+ }
+ else if (*pTmp=='\'')
{
- if (!strchr(pToks,*pTmp) || (*(pTmp-1)=='\\'))
- pTmp++;
- else
+ pTmp++;
+ while (*pTmp && *pTmp!='\'') pTmp++;
+ if (*pTmp) pTmp++;
+ pStop=pTmp;
+ if (!*pTmp || strchr(pToks,*pTmp))
break;
}
- #else
- while (!strchr(pToks,*pTmp)) pTmp++;
- #endif
- pStop=pTmp;
+ else if (!*pTmp)
+ {
+ pStop=pTmp;
+ break;
+ }
+ else
+ {
+ pTmp++;
+ #if OSPATHSEP=='/'
+ while (*pTmp)
+ {
+ if (!strchr(pToks,*pTmp) || (*(pTmp-1)=='\\'))
+ pTmp++;
+ else
+ break;
+ }
+ #else
+ while (!strchr(pToks,*pTmp)) pTmp++;
+ #endif
+ pStop=pTmp;
+ break;
+ }
}
Output=string(pStart,pStop);
// skip trailing space
|