From 5b18608b26830b95fbfad8a0d106339c68fe2a39 Mon Sep 17 00:00:00 2001 From: Ahurac Date: Fri, 8 Nov 2024 11:49:39 +0100 Subject: [PATCH] fix(main): decalre args upstream --- src/main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index e776132..3fc88cb 100644 --- a/src/main.c +++ b/src/main.c @@ -8,17 +8,20 @@ int main() { char *input_line; unsigned char exit_code = 0; + struct Args args; while (1) { + args.argc = 0; + printf("$ "); input_line = read_a_line(stdin); if (input_line == NULL) { return exit_code; + } else { + args = parse(input_line); + free(input_line); } - struct Args args = parse(input_line); - free(input_line); - if (args.argc > 0) { exit_code = invoke(args); }