This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit 573008244c60b74b737b88ae36106400cb039913 Author: guoshichao <[email protected]> AuthorDate: Thu Aug 1 21:55:21 2024 +0800 greenhills: fix the variable unused warning "nsh_parse.c", line 1565: warning #550-D: variable "quoted" was set but never used bool quoted; ^ Signed-off-by: guoshichao <[email protected]> --- nshlib/nsh_parse.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/nshlib/nsh_parse.c b/nshlib/nsh_parse.c index 7b0672db8..14cf1e879 100644 --- a/nshlib/nsh_parse.c +++ b/nshlib/nsh_parse.c @@ -1727,10 +1727,12 @@ static FAR char *nsh_argument(FAR struct nsh_vtbl_s *vtbl, FAR char *argument = NULL; #ifdef CONFIG_NSH_QUOTE FAR char *prev; - bool escaped; + bool escaped = false; +#endif + bool squote = false; +#ifdef CONFIG_NSH_ALIAS + bool quoted = false; #endif - bool squote; - bool quoted; /* Find the beginning of the next token */ @@ -1794,11 +1796,7 @@ static FAR char *nsh_argument(FAR struct nsh_vtbl_s *vtbl, * make sure that we do not break up any quoted substrings. */ - squote = false; - quoted = false; #ifdef CONFIG_NSH_QUOTE - escaped = false; - for (prev = NULL, pend = pbegin; *pend != '\0'; prev = pend, pend++) #else for (pend = pbegin; *pend != '\0'; pend++) @@ -1829,7 +1827,11 @@ static FAR char *nsh_argument(FAR struct nsh_vtbl_s *vtbl, /* Are we entering a quoted string ? */ +#ifdef CONFIG_NSH_ALIAS if ((quoted = (nsh_strchr(g_quote_separator, *pend) != NULL))) +#else + if (nsh_strchr(g_quote_separator, *pend) != NULL) +#endif { /* Yes, find the terminator and continue from there */
