Author: janderwald
Date: Wed Sep 5 02:44:01 2007
New Revision: 28864
URL:
http://svn.reactos.org/svn/reactos?rev=28864&view=rev
Log:
- split boot cmd into tokens
Modified:
trunk/reactos/tools/sysreg/rosboot_test.cpp
Modified: trunk/reactos/tools/sysreg/rosboot_test.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/rosboot_test.…
==============================================================================
--- trunk/reactos/tools/sysreg/rosboot_test.cpp (original)
+++ trunk/reactos/tools/sysreg/rosboot_test.cpp Wed Sep 5 02:44:01 2007
@@ -76,10 +76,34 @@
//---------------------------------------------------------------------------------------
bool RosBootTest::executeBootCmd()
{
- m_Pid = OsSupport::createProcess ((TCHAR*)m_BootCmd.c_str(), 0, NULL, false);
+ int numargs = 0;
+ char * args[128];
+ char * pBuf;
+ char szBuffer[128];
+
+ pBuf = (char*)m_BootCmd.c_str ();
+ if (pBuf)
+ {
+ pBuf = strtok(pBuf, _T(" "));
+ while(pBuf != NULL)
+ {
+ if (!numargs)
+ strcpy(szBuffer, pBuf);
+
+ args[numargs] = pBuf;
+ numargs++;
+ pBuf = _tcstok(NULL, _T(" "));
+ }
+ args[numargs++] = 0;
+ }
+ else
+ {
+ strcpy(szBuffer, pBuf);
+ }
+ m_Pid = OsSupport::createProcess (szBuffer, numargs-1, args, false);
if (!m_Pid)
{
- cerr << "Error: failed to launch boot cmd" << m_BootCmd
<< endl;
+ cerr << "Error: failed to launch boot cmd " <<
m_BootCmd << endl;
return false;
}