mirror of
https://github.com/samsonjs/csc360-a1-shell.git
synced 2026-03-31 09:45:47 +00:00
[c] Make wordexp fail on undefined variables
This commit is contained in:
parent
cd864989ce
commit
32a4f6b894
1 changed files with 1 additions and 1 deletions
2
c/main.c
2
c/main.c
|
|
@ -219,7 +219,7 @@ int handle_wordexp_result(int result, char *cmd) {
|
|||
|
||||
int process_command(char *line, options_t options) {
|
||||
wordexp_t words;
|
||||
int result = wordexp(line, &words, WRDE_SHOWERR);
|
||||
int result = wordexp(line, &words, WRDE_SHOWERR | WRDE_UNDEF);
|
||||
if (handle_wordexp_result(result, line) && words.we_wordc > 0) {
|
||||
if (options->verbose) {
|
||||
int i;
|
||||
|
|
|
|||
Loading…
Reference in a new issue