5cae98d868c895db90aa53ec845b02fbd1ff6d66 — Simon Ser 9 days ago c0dc3f0
Add expand_pathnames error handling in expand_word
1 files changed, 3 insertions(+), 1 deletions(-)

M shell/task/word.c
M shell/task/word.c => shell/task/word.c +3 -1
@@ 610,7 610,9 @@ int expand_word(struct mrsh_context *ctx, const struct mrsh_word *_word,
 	if (ctx->state->options & MRSH_OPT_NOGLOB) {
 		get_fields_str(expanded_fields, &fields);
 	} else {
-		expand_pathnames(expanded_fields, &fields);
+		if (!expand_pathnames(expanded_fields, &fields)) {
+			return TASK_STATUS_ERROR;
+		}
 	}
 
 	for (size_t i = 0; i < fields.len; ++i) {