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:
parent
650e2daa9f
commit
c7a9534359
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue