From 374b77ed9ee573da3f47f4fdaaf69cc82d657c52 Mon Sep 17 00:00:00 2001 From: Francis Laniel Date: Fri, 22 Dec 2023 22:02:39 +0100 Subject: cli: hush_modern: Enable if keyword Adds support for "if then else" construct both for command line interface and through run_command(). Signed-off-by: Francis Laniel Reviewed-by: Simon Glass --- common/cli_hush_modern.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'common/cli_hush_modern.c') diff --git a/common/cli_hush_modern.c b/common/cli_hush_modern.c index 15bb1f0d92..6360747f21 100644 --- a/common/cli_hush_modern.c +++ b/common/cli_hush_modern.c @@ -33,6 +33,7 @@ */ #define ENABLE_HUSH_INTERACTIVE 1 #define ENABLE_FEATURE_EDITING 1 +#define ENABLE_HUSH_IF 1 /* No MMU in U-Boot */ #define BB_MMU 0 #define USE_FOR_NOMMU(...) __VA_ARGS__ @@ -124,6 +125,11 @@ static void bb_error_msg(const char *s, ...) va_end(p); } +static void bb_simple_error_msg(const char *s) +{ + bb_error_msg("%s", s); +} + static void *xmalloc(size_t size) { void *p = NULL; @@ -147,6 +153,11 @@ static void *xrealloc(void *ptr, size_t size) return p; } +static void *xmemdup(const void *s, int n) +{ + return memcpy(xmalloc(n), s, n); +} + #define xstrdup strdup #define xstrndup strndup -- cgit v1.2.3