environ #15

Merged
cromer merged 27 commits from environ into master 2021-07-17 22:15:24 -04:00
Showing only changes of commit 94a32f28f6 - Show all commits

View File

@ -218,6 +218,10 @@ void echo(StringArray *args) {
} }
fprintf(stdout, "%s", value); fprintf(stdout, "%s", value);
} }
if (variable != NULL) {
free(variable);
variable = NULL;
}
} }
else { else {
if (i != 1) { if (i != 1) {
@ -236,4 +240,5 @@ void echo(StringArray *args) {
} }
fprintf(stderr, "The variable %s doesn't exist!\n", no_variables->array[i]); fprintf(stderr, "The variable %s doesn't exist!\n", no_variables->array[i]);
} }
free_string_array(no_variables);
} }