diff options
Diffstat (limited to '')
| -rw-r--r-- | Makefile | 4 | ||||
| -rw-r--r-- | src/shell.c | 6 |
2 files changed, 7 insertions, 3 deletions
| @@ -9,7 +9,9 @@ CPPFLAGS = -DVERSION=\"${VERSION}\" | |||
| 9 | CFLAGS = -std=c99 -pthread -pedantic -Wall -Wextra \ | 9 | CFLAGS = -std=c99 -pthread -pedantic -Wall -Wextra \ |
| 10 | -Wno-unused-parameter -O3 ${CPPFLAGS} | 10 | -Wno-unused-parameter -O3 ${CPPFLAGS} |
| 11 | DBGFLAGS = -std=c99 -pthread -pedantic -Wall -Wextra \ | 11 | DBGFLAGS = -std=c99 -pthread -pedantic -Wall -Wextra \ |
| 12 | -Wno-unused-parameter -g ${CPPFLAGS} | 12 | -Wno-unused-parameter -Wno-unused-function \ |
| 13 | -fsanitize=address -fsanitize=undefined \ | ||
| 14 | -g3 ${CPPFLAGS} | ||
| 13 | 15 | ||
| 14 | CC = cc | 16 | CC = cc |
| 15 | 17 | ||
diff --git a/src/shell.c b/src/shell.c index 9c3173b..3c19a31 100644 --- a/src/shell.c +++ b/src/shell.c | |||
| @@ -64,13 +64,13 @@ exec_args(int c, char **v) | |||
| 64 | 64 | ||
| 65 | if (cmd == NULL) { | 65 | if (cmd == NULL) { |
| 66 | fprintf(stderr, "%s: command not found\n", v[0]); | 66 | fprintf(stderr, "%s: command not found\n", v[0]); |
| 67 | return; | 67 | goto exec_args_end; |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | args = cmd->parse_args(c-1, &v[1]); | 70 | args = cmd->parse_args(c-1, &v[1]); |
| 71 | if (!args->success) { | 71 | if (!args->success) { |
| 72 | fprintf(stderr, "usage: %s\n", cmd->usage); | 72 | fprintf(stderr, "usage: %s\n", cmd->usage); |
| 73 | return; | 73 | goto exec_args_end; |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | if (args->scrstdin) { | 76 | if (args->scrstdin) { |
| @@ -94,6 +94,8 @@ exec_args(int c, char **v) | |||
| 94 | } else { | 94 | } else { |
| 95 | cmd->exec(args); | 95 | cmd->exec(args); |
| 96 | } | 96 | } |
| 97 | |||
| 98 | exec_args_end: | ||
| 97 | free_args(args); | 99 | free_args(args); |
| 98 | } | 100 | } |
| 99 | 101 | ||
