aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--common.cpp21
-rw-r--r--common.h6
-rw-r--r--exec.cpp6
3 files changed, 4 insertions, 29 deletions
diff --git a/common.cpp b/common.cpp
index 825d2501..ae421de4 100644
--- a/common.cpp
+++ b/common.cpp
@@ -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;
diff --git a/common.h b/common.h
index a5ec50ab..5c462974 100644
--- a/common.h
+++ b/common.h
@@ -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
diff --git a/exec.cpp b/exec.cpp
index 4b9e1f37..62523a8c 100644
--- a/exec.cpp
+++ b/exec.cpp
@@ -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);
}