summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2013-02-07 22:31:38 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-02-11 20:57:33 +0100
commitc7a9534359ad0ea59ef8d985d03cc4bcc771795d (patch)
tree22f97cd6dc8934d23599095dac2b01ea1d9d8c34
parent650e2daa9fc847aaced5302b2a287da2d1d58c04 (diff)
downloadbarebox-c7a9534359ad0ea59ef8d985d03cc4bcc771795d.tar.gz
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 <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--common/hush.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/hush.c b/common/hush.c
index 1f468f6..602f8f1 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);