Add check if variable exists

This commit is contained in:
g1n 2021-09-19 17:55:08 +03:00
parent 55616d1fb3
commit 0edcd01321
1 changed files with 4 additions and 1 deletions

View File

@ -79,8 +79,11 @@ int parse_command(char **command, int status) {
char status_string[256]; // FIXME
sprintf(status_string, "%d", status);
command[i] = status_string;
} else
} else {
command[i] = getenv(command[i]);
if (command[i] == NULL)
command[i] = "";
}
}
}
}