shithub: mc

Download patch

ref: 11f0b71e1df81a2764d6dc0de9903f9a6d6ef7a6
parent: 9a388068afc910ad273cb32a983f7cd4ed6c6f51
author: Ori Bernstein <[email protected]>
date: Thu Jan 9 16:39:04 EST 2014

Fix execv on osx.

    There were a few typos.

--- a/libstd/sys-osx.myr
+++ b/libstd/sys-osx.myr
@@ -544,15 +544,16 @@
 }
 
 const execv	= {cmd, args
-	var cargs, i
+	var p, cargs, i
 
 	/* doesn't just call execve() for efficiency's sake. */
-	cargs = (alloca(sizeof(byte#)*(args.len + 1)) castto(byte##))[:args.len]
+	p = alloca((args.len + 1)*sizeof(byte#))
+	cargs = (p castto(byte##))[:args.len]
 	for i = 0; i < args.len; i++
 		cargs[i] = cstring(args[i])
 	;;
 	cargs[args.len] = 0 castto(byte#)
-	-> syscall(Sysexecve, cmd castto(byte#), cargs, __cenvp)
+	-> syscall(Sysexecve, cstring(cmd), p, __cenvp)
 }
 
 const execve	= {cmd, args, env