fixing ctrl+d error
This commit is contained in:
@@ -15,6 +15,11 @@ int main() {
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
cmd = read_input();
|
cmd = read_input();
|
||||||
|
// CTRL+D will set cmd to null
|
||||||
|
// Shell should exit if encountered
|
||||||
|
if (cmd == NULL) {
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
args = split_cmd(cmd);
|
args = split_cmd(cmd);
|
||||||
status_return = reverse_execute(args);
|
status_return = reverse_execute(args);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user