char **newargs;
int i, k = 0;
-#ifdef _WIN32
- /* CommandLineToArgvW() might return a different argc than the
- * one passed to main(), so let it overwrite that, as we won't
- * use argv[] on Windows anyway.
- */
- wchar_t **wargv = CommandLineToArgvW (GetCommandLineW (), &argc);
-#endif
-
newargs = (char **) malloc (sizeof (char *) * (argc + 2) + count_mono_options_args ());
-#ifdef _WIN32
- newargs [k++] = g_utf16_to_utf8 (wargv [0], -1, NULL, NULL, NULL);
-#else
newargs [k++] = argv [0];
-#endif
if (mono_options != NULL) {
i = 0;
newargs [k++] = image_name;
for (i = 1; i < argc; i++) {
-#ifdef _WIN32
- newargs [k++] = g_utf16_to_utf8 (wargv [i], -1, NULL, NULL, NULL);
-#else
newargs [k++] = argv [i];
-#endif
}
-#ifdef _WIN32
- LocalFree (wargv);
-#endif
newargs [k] = NULL;
if (config_dir != NULL && getenv ("MONO_CFG_DIR") == NULL)