mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring@gmail.com>
To: barebox@lists.infradead.org
Subject: [PATCH 1/4] hush: add getopt only if it enabled
Date: Thu,  7 Feb 2013 22:31:38 +0100	[thread overview]
Message-ID: <1360272701-877-2-git-send-email-alex.aring@gmail.com> (raw)
In-Reply-To: <1360272701-877-1-git-send-email-alex.aring@gmail.com>

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>
---
 common/hush.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-02-07 21:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-07 21:31 [PATCH v2 0/4] Small fixes in barebox Alexander Aring
2013-02-07 21:31 ` Alexander Aring [this message]
2013-02-07 21:31 ` [PATCH 2/4] getopt: change optstring to const char* Alexander Aring
2013-02-07 21:31 ` [PATCH 3/4] sata-imx: fix depends on ARCH_IMX Alexander Aring
2013-02-07 21:31 ` [PATCH 4/4] net: fix cpsw depends on ARCH_OMAP Alexander Aring
2013-02-08  8:37 ` [PATCH v2 0/4] Small fixes in barebox Sascha Hauer
  -- strict thread matches above, loose matches on Subject: below --
2013-02-07 20:36 [PATCH " Alexander Aring
2013-02-07 20:36 ` [PATCH 1/4] hush: add getopt only if it enabled Alexander Aring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1360272701-877-2-git-send-email-alex.aring@gmail.com \
    --to=alex.aring@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox