don't fork upon empty commands in linux's msh_execute

This commit is contained in:
IoIxD 2026-01-15 22:29:53 -07:00
commit 294261bdc7

View file

@ -26,6 +26,9 @@ void msh_write(unsigned char *st, SIZE_TYPE size) {
} }
int msh_execute(unsigned char *cmd, unsigned char **args) { int msh_execute(unsigned char *cmd, unsigned char **args) {
if (*cmd == '\0') {
return 0;
}
SIZE_TYPE fork = (SIZE_TYPE)SYSCALL(fork, 0); SIZE_TYPE fork = (SIZE_TYPE)SYSCALL(fork, 0);
// int fork = 0; // int fork = 0;
if (fork == 0) { if (fork == 0) {