9
0
Fork 0

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>
This commit is contained in:
Alexander Aring 2013-02-07 22:31:38 +01:00 committed by Sascha Hauer
parent 650e2daa9f
commit c7a9534359
1 changed files with 2 additions and 1 deletions

View File

@ -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);