summaryrefslogtreecommitdiffstats
path: root/common/hush.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-05-18 18:43:04 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-05-21 09:08:29 +0200
commit9448aa57ec58ac6f51fe970595517972e36cf44d (patch)
tree0c2d8d6a4a7ae3a1b3a6c1c2ca2e34d74bc63c5b /common/hush.c
parentc48de4beee21c3a5573cec084123c33ae08f6f7a (diff)
downloadbarebox-9448aa57ec58ac6f51fe970595517972e36cf44d.tar.gz
run_shell: run again on ctrl-c
We can start a new interactive shell now using the 'sh' command on the command line. This shell exits on ctrl-c though. Add a loop around it to continue instead of exiting. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/hush.c')
-rw-r--r--common/hush.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/common/hush.c b/common/hush.c
index 3d51e4c..8e8dd03 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -1612,7 +1612,6 @@ static int parse_stream_outer(struct p_context *ctx, struct in_str *inp, int fla
}
if (inp->__promptme == 0)
printf("<INTERRUPT>\n");
- inp->__promptme = 1;
temp.nonnull = 0;
temp.quote = 0;
free_pipe_list(ctx->list_head,0);
@@ -1807,9 +1806,12 @@ int run_shell(void)
struct in_str input;
struct p_context ctx;
- setup_file_in_str(&input);
- rcode = parse_stream_outer(&ctx, &input, FLAG_PARSE_SEMICOLON);
- release_context(&ctx);
+ do {
+ setup_file_in_str(&input);
+ rcode = parse_stream_outer(&ctx, &input, FLAG_PARSE_SEMICOLON);
+ release_context(&ctx);
+ } while (!input.__promptme);
+
return rcode;
}