From 0797ee231254630c96111afba7997e83e106c244 Mon Sep 17 00:00:00 2001 From: Marco Casaroli Date: Sat, 10 Aug 2024 13:08:10 +0200 Subject: [PATCH] fix(nsh_parse): handle env variables correctly The PR #2469 broke handling of environment variables because an error in the if/else if control flow. This fixes it. --- nshlib/nsh_parse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nshlib/nsh_parse.c b/nshlib/nsh_parse.c index 80eed7703..7b0672db8 100644 --- a/nshlib/nsh_parse.c +++ b/nshlib/nsh_parse.c @@ -2734,7 +2734,8 @@ static int nsh_parse_command(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline) argv[argc] = pbegin; } } - else if (!strncmp(argv[argc], g_redirect_out2, redirect_out2_len)) + + if (!strncmp(argv[argc], g_redirect_out2, redirect_out2_len)) { FAR char *arg; if (argv[argc][redirect_out2_len])