git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@821
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
void wxApp::ConvertToStandardCommandArgs(char* lpCmdLine)
{
// Split command line into tokens, as in usual main(argc, argv)
void wxApp::ConvertToStandardCommandArgs(char* lpCmdLine)
{
// Split command line into tokens, as in usual main(argc, argv)
- char **command = new char*[50]; // VZ: sure? why not 25 or 73 and a half??
-
- int count = 0;
char *buf = new char[strlen(lpCmdLine) + 1];
char *buf = new char[strlen(lpCmdLine) + 1];
/* Model independent strcpy */
/* Model independent strcpy */
- int i;
- for (i = 0; (buf[i] = lpCmdLine[i]) != 0; i++)
+ unsigned int i;
+ for (i = 0; i<strlen(lpCmdLine); i++)
+ buf[i]=lpCmdLine[i];
+ if (isspace(lpCmdLine[i]))
+ para++;
+ buf[i]=0;
+ char **command = new char*[para+2];
// Get application name
char name[260]; // 260 is MAX_PATH value from windef.h
// Get application name
char name[260]; // 260 is MAX_PATH value from windef.h
wxTheApp->argc = count;
for (i = 0; i < count; i++)
wxTheApp->argc = count;
for (i = 0; i < count; i++)
wxTheApp->argv[i] = copystring(command[i]);
wxTheApp->argv[i] = copystring(command[i]);
- delete [] command[i];
- }
+#if !defined(__GNUWIN32__)
+// use copystring than delete this pointer
+ delete [] command[0];
+#endif
delete [] command;
delete [] buf;
delete [] command;
delete [] buf;