fix(main): decalre args upstream
This commit is contained in:
parent
7b1b49c2d1
commit
5b18608b26
1 changed files with 6 additions and 3 deletions
|
@ -8,16 +8,19 @@
|
|||
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;
|
||||
}
|
||||
|
||||
struct Args args = parse(input_line);
|
||||
} else {
|
||||
args = parse(input_line);
|
||||
free(input_line);
|
||||
}
|
||||
|
||||
if (args.argc > 0) {
|
||||
exit_code = invoke(args);
|
||||
|
|
Loading…
Reference in a new issue