From e46b50d110ba30dc7303b7ad78e214ac98eb5366 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Tue, 4 Sep 2007 22:44:01 +0000 Subject: [PATCH] - split boot cmd into tokens svn path=/trunk/; revision=28864 --- reactos/tools/sysreg/rosboot_test.cpp | 28 +++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/reactos/tools/sysreg/rosboot_test.cpp b/reactos/tools/sysreg/rosboot_test.cpp index 147fa3e716e..1412597e4ba 100644 --- a/reactos/tools/sysreg/rosboot_test.cpp +++ b/reactos/tools/sysreg/rosboot_test.cpp @@ -76,10 +76,34 @@ namespace Sysreg_ //--------------------------------------------------------------------------------------- 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; }