summaryrefslogtreecommitdiff
path: root/shell/hush.c
diff options
context:
space:
mode:
authorDenis Vlasenko2008-07-14 08:26:47 +0000
committerDenis Vlasenko2008-07-14 08:26:47 +0000
commit757361f9f58e120ddb9855fa0f50e12b921c37f0 (patch)
treef3f7bbe64e3e0dcf394205b7c5c8fa6046c38d1e /shell/hush.c
parent395ae452165a607c6b5bc4623225516044619616 (diff)
downloadbusybox-757361f9f58e120ddb9855fa0f50e12b921c37f0.zip
busybox-757361f9f58e120ddb9855fa0f50e12b921c37f0.tar.gz
hush: fix "... pattern) cmd;; esac" case
Diffstat (limited to 'shell/hush.c')
-rw-r--r--shell/hush.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/shell/hush.c b/shell/hush.c
index db60801..47cdf6f 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -2986,7 +2986,9 @@ static int done_word(o_string *word, struct p_context *ctx)
}
#if HAS_KEYWORDS
#if ENABLE_HUSH_CASE
- if (ctx->ctx_dsemicolon) {
+ if (ctx->ctx_dsemicolon
+ && strcmp(word->data, "esac") != 0 /* not "... pattern) cmd;; esac" */
+ ) {
/* already done when ctx_dsemicolon was set to 1: */
/* ctx->ctx_res_w = RES_MATCH; */
ctx->ctx_dsemicolon = 0;
@@ -3112,7 +3114,7 @@ static void done_pipe(struct p_context *ctx, pipe_style type)
if (not_null IF_HAS_KEYWORDS(|| ctx->ctx_res_w != RES_NONE)) {
struct pipe *new_p;
debug_printf_parse("done_pipe: adding new pipe: "
- " not_null:%d ctx->ctx_res_w:%d\n",
+ "not_null:%d ctx->ctx_res_w:%d\n",
not_null, ctx->ctx_res_w);
new_p = new_pipe();
ctx->pipe->next = new_p;