From 6fe04dcbfeaaf06ae7f16a8b2d2347a77c8a78eb Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Thu, 21 Sep 2006 08:03:56 +0000 Subject: PR#4112, tentative fix git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7626 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- otherlibs/win32unix/system.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'otherlibs/win32unix/system.c') diff --git a/otherlibs/win32unix/system.c b/otherlibs/win32unix/system.c index 725817c37..9cf3e89cc 100644 --- a/otherlibs/win32unix/system.c +++ b/otherlibs/win32unix/system.c @@ -26,11 +26,17 @@ CAMLprim value win_system(cmd) { int ret; value st; + char *buf; + intnat len; + len = caml_string_length (cmd); + buf = caml_stat_alloc (len + 1); + memmove (buf, String_val (cmd), len + 1); enter_blocking_section(); _flushall(); - ret = system(String_val(cmd));; + ret = system(buf); leave_blocking_section(); + caml_stat_free(buf); if (ret == -1) uerror("system", Nothing); st = alloc_small(1, 0); /* Tag 0: Exited */ Field(st, 0) = Val_int(ret); -- cgit v1.2.3-70-g09d2