shithub: npe

Download patch

ref: 6b73a1db16534e4a4f6d6c2565a680668b2c210f
parent: 48cf11c75a2d86f7b91b5fd8667e92458e7af271
author: Noam Preil <noam@pixelhero.dev>
date: Fri Dec 12 05:00:34 EST 2025

system cleanup

--- a/libnpe/system.c
+++ b/libnpe/system.c
@@ -9,14 +9,14 @@
 	pid_t pid;
 	char cmd[30], *oty;
 
-	oty = getenv("cputype");
-	if(!oty)
-		return -1;
 	if(!s)
 		return 1; /* a command interpreter is available */
 	pid = fork();
-	snprintf(cmd, sizeof cmd, "/%s/bin/rc", oty);
 	if(pid == 0){
+		oty = getenv("cputype");
+		if(!oty)
+			return -1;
+		snprintf(cmd, sizeof cmd, "/%s/bin/rc", oty);
 		execl(cmd, "rc", "-c", s, NULL);
 		exits(nil);
 	}
--