summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-03-28 09:32:56 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2014-03-28 09:36:36 +0100
commit45693e0265d086b031739132d64d240b9afd038e (patch)
tree08ed7f38ed96e0538e79effaa0f8c89bf5b40f94 /include
parent237cbf1ac7a4799bc6e6b4ce0233a5dafa8de94a (diff)
downloadbarebox-45693e0265d086b031739132d64d240b9afd038e.tar.gz
barebox-45693e0265d086b031739132d64d240b9afd038e.tar.xz
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')
-rw-r--r--include/common.h9
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))