fix(main): decalre args upstream
This commit is contained in:
parent
7b1b49c2d1
commit
5b18608b26
1 changed files with 6 additions and 3 deletions
|
@ -8,17 +8,20 @@
|
||||||
int main() {
|
int main() {
|
||||||
char *input_line;
|
char *input_line;
|
||||||
unsigned char exit_code = 0;
|
unsigned char exit_code = 0;
|
||||||
|
struct Args args;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
args.argc = 0;
|
||||||
|
|
||||||
printf("$ ");
|
printf("$ ");
|
||||||
input_line = read_a_line(stdin);
|
input_line = read_a_line(stdin);
|
||||||
if (input_line == NULL) {
|
if (input_line == NULL) {
|
||||||
return exit_code;
|
return exit_code;
|
||||||
|
} else {
|
||||||
|
args = parse(input_line);
|
||||||
|
free(input_line);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Args args = parse(input_line);
|
|
||||||
free(input_line);
|
|
||||||
|
|
||||||
if (args.argc > 0) {
|
if (args.argc > 0) {
|
||||||
exit_code = invoke(args);
|
exit_code = invoke(args);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue