shithub: mc

Download patch

ref: 90ef85abfcb2d9af2ec37fd34de1c62f2fe150c6
parent: 67ec1a16297664c91a52f7a4380f3b7f2a1c66fc
author: Ori Bernstein <ori@eigenstate.org>
date: Mon Feb 23 04:16:07 EST 2015

Fix stupid mistake in exec() change.

--- a/libstd/execvp.myr
+++ b/libstd/execvp.myr
@@ -12,7 +12,7 @@
 ;;
 
 const execvp = {cmd, args
-	var paths, cmd
+	var paths, binpath
 	var buf : byte[512]
 
 	match strfind(cmd, "/")
@@ -21,8 +21,8 @@
 	| `None:
 		paths = getpaths()
 		for p in paths
-			cmd = bfmt(buf[:], "%s/%s", p, cmd)
-			execv(cmd, args)
+			binpath = bfmt(buf[:], "%s/%s", p, cmd)
+			execv(binpath, args)
 		;;
 		slfree(paths)
 	;;
@@ -30,7 +30,7 @@
 }
 
 const execvpe = {cmd, args, env
-	var paths, cmd
+	var paths, binpath
 	var buf : byte[512]
 
 	match strfind(cmd, "/")
@@ -39,8 +39,8 @@
 	| `None:
 		paths = getpaths()
 		for p in paths
-			cmd = bfmt(buf[:], "%s/%s", p, cmd)
-			execve(cmd, args, env)
+			binpath = bfmt(buf[:], "%s/%s", p, cmd)
+			execve(binpath, args, env)
 		;;
 		slfree(paths)
 	;;