diff options
-rw-r--r-- | interactive.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/interactive.c b/interactive.c index 7460327..c429513 100644 --- a/interactive.c +++ b/interactive.c @@ -17,9 +17,12 @@ * */ +#define _XOPEN_SOURCE 700 + #include "sh.h" #include <stdio.h> #include <stdlib.h> +#include <string.h> static char *sh_getline(char **cmdline) { @@ -42,6 +45,11 @@ int sh_interactive(void) break; } + if (!strcmp(cmdline, "\n")) { + free(cmdline); + continue; + } + struct command *command = sh_parse(cmdline); while (command == NULL) { /* append more text */ |