From 0536c5b523807ef131ce668a2b2f676c32bcadf7 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 24 Dec 2019 12:18:30 -0600 Subject: [PATCH] apps/nshlib/nsh_parse.c: Correct an error found in build testing. Commit 2a462c78aa5f4ea6dc374eedd86bc85f9f79a0c4 was insufficient. It was a mistake to revert Xiang's change of commit 9defae8af641752506d92b72ea68c8f94d24d580. But we are on a different vector now. --- nshlib/nsh_parse.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/nshlib/nsh_parse.c b/nshlib/nsh_parse.c index e85abe92d..7447f0692 100644 --- a/nshlib/nsh_parse.c +++ b/nshlib/nsh_parse.c @@ -92,6 +92,15 @@ # define NSH_MEMLIST_FREE(m) #endif +/* Do we need g_nullstring[]? */ + +#undef NEED_NULLSTRING +#if defined(NSH_HAVE_VARS) || defined(CONFIG_NSH_CMDPARMS) +# define NEED_NULLSTRING 1 +#elif !defined(CONFIG_NSH_ARGCAT) || !defined(HAVE_MEMLIST) +# define NEED_NULLSTRING 1 +#endif + /**************************************************************************** * Private Types ****************************************************************************/ @@ -222,7 +231,7 @@ static const char g_exitstatus[] = "?"; static const char g_success[] = "0"; static const char g_failure[] = "1"; #endif -#if defined(NSH_HAVE_VARS) || defined(CONFIG_NSH_CMDPARMS) +#ifdef NEED_NULLSTRING static const char g_nullstring[] = ""; #endif