[PATCH 12/13] hush: allow to run interactive shell in do_sh

Sascha Hauer s.hauer at pengutronix.de
Mon Apr 30 07:19:27 EDT 2012


This allows to call 'sh' in scripts without arguments in which
case an interactive shell will be started.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/hush.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/hush.c b/common/hush.c
index ab513af..d915f9e 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -1814,7 +1814,7 @@ int run_shell(void)
 static int do_sh(int argc, char *argv[])
 {
 	if (argc < 2)
-		return COMMAND_ERROR_USAGE;
+		return run_shell();
 
 	return execute_script(argv[1], argc - 1, argv + 1);
 }
-- 
1.7.10




More information about the barebox mailing list