ould you explain why it isn't helpful,
Because CreateProcess() is the only way to spawn a new process on windows; and it only accepts a single string containing the runtime arguments.
If you supply system with the list form of arguments, they just get concatenated together, before being passed as the second argument to CreateProcess().
There is some attempt to apply intelligence to the concatenation process, but is does not handle paths with spaces (correctly):
win32_spawnvp(int mode, const char *cmdname, const char *const *argv)
{
#ifdef USE_RTL_SPAWNVP
return spawnvp(mode, cmdname, (char * const *)argv);
#else
dTHXa(NULL);
int ret;
void* env;
char* dir;
child_IO_table tbl;
STARTUPINFO StartupInfo;
PROCESS_INFORMATION ProcessInformation;
DWORD create = 0;
char *cmd;
char *fullcmd = NULL;
char *cname = (char *)cmdname;
STRLEN clen = 0;
if (cname) {
clen = strlen(cname);
/* if command name contains dquotes, must remove them */
...
About the dumbest thing it could do...
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|