From c7a9534359ad0ea59ef8d985d03cc4bcc771795d Mon Sep 17 00:00:00 2001 From: Alexander Aring Date: Thu, 7 Feb 2013 22:31:38 +0100 Subject: hush: add getopt only if it enabled This patch add getopt to the command list if it enabled via Kconfig. With this patch we get a 'command not found' error. Otherwise getopt doing nothing. Signed-off-by: Alexander Aring Signed-off-by: Sascha Hauer --- common/hush.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/hush.c b/common/hush.c index 1f468f601a..602f8f1be1 100644 --- a/common/hush.c +++ b/common/hush.c @@ -782,7 +782,8 @@ static int run_pipe_real(struct p_context *ctx, struct pipe *pi) remove_quotes(globbuf.gl_pathc, globbuf.gl_pathv); - if (!strcmp(globbuf.gl_pathv[0], "getopt")) { + if (!strcmp(globbuf.gl_pathv[0], "getopt") && + IS_ENABLED(CONFIG_HUSH_GETOPT)) { ret = builtin_getopt(ctx, child, globbuf.gl_pathc, globbuf.gl_pathv); } else if (!strcmp(globbuf.gl_pathv[0], "exit")) { ret = builtin_exit(ctx, child, globbuf.gl_pathc, globbuf.gl_pathv); -- cgit v1.2.3