diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-03-28 09:32:56 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-03-28 09:36:36 +0100 |
commit | 45693e0265d086b031739132d64d240b9afd038e (patch) | |
tree | 08ed7f38ed96e0538e79effaa0f8c89bf5b40f94 /include/common.h | |
parent | 237cbf1ac7a4799bc6e6b4ce0233a5dafa8de94a (diff) | |
download | barebox-45693e0265d086b031739132d64d240b9afd038e.tar.gz |
Add shell_expand function
shell_expand expands shell variables in a string.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/common.h')
-rw-r--r-- | include/common.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/common.h b/include/common.h index 6987b4f16d..bfd3ce8b7b 100644 --- a/include/common.h +++ b/include/common.h @@ -165,6 +165,15 @@ void arch_shutdown(void); int run_shell(void); +#ifdef CONFIG_SHELL_HUSH +char *shell_expand(char *str); +#else +static inline char *shell_expand(char *str) +{ + return strdup(str); +} +#endif + /* Force a compilation error if condition is true */ #define BUILD_BUG_ON(condition) ((void)BUILD_BUG_ON_ZERO(condition)) |