diff options
-rw-r--r-- | common.cpp | 21 | ||||
-rw-r--r-- | common.h | 6 | ||||
-rw-r--r-- | exec.cpp | 6 |
3 files changed, 4 insertions, 29 deletions
@@ -383,27 +383,6 @@ static char *wcs2str_internal(const wchar_t *in, char *out) return out; } -char **wcsv2strv(const wchar_t * const *in) -{ - size_t i, count = 0; - - while (in[count] != 0) - count++; - char **res = (char **)malloc(sizeof(char *)*(count+1)); - if (res == 0) - { - DIE_MEM(); - } - - for (i=0; i<count; i++) - { - res[i]=wcs2str(in[i]); - } - res[count]=0; - return res; - -} - wcstring format_string(const wchar_t *format, ...) { va_list va; @@ -683,12 +683,6 @@ void append_format(wcstring &str, const wchar_t *format, ...); void append_formatv(wcstring &str, const wchar_t *format, va_list ap); /** - Returns a newly allocated wide character string array equivalent of - the specified multibyte character string array -*/ -char **wcsv2strv(const wchar_t * const *in); - -/** Test if the given string is a valid variable name. \return null if this is a valid name, and a pointer to the first invalid character otherwise @@ -361,12 +361,14 @@ static void launch_process_nofork(process_t *p) ASSERT_IS_MAIN_THREAD(); ASSERT_IS_NOT_FORKED_CHILD(); - char **argv = wcsv2strv(p->get_argv()); + null_terminated_array_t<char> argv_array; + convert_wide_array_to_narrow(p->get_argv_array(), &argv_array); + const char *const *envv = env_export_arr(false); char *actual_cmd = wcs2str(p->actual_cmd.c_str()); /* Bounce to launch_process. This never returns. */ - safe_launch_process(p, actual_cmd, argv, envv); + safe_launch_process(p, actual_cmd, argv_array.get(), envv); } |