linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Zaytsev <alexey.zaytsev@gmail.com>
To: Josh Triplett <josh@kernel.org>
Cc: Blue Swirl <blauwirbel@gmail.com>,
	Christopher Li <sparse@chrisli.org>,
	linux-sparse@vger.kernel.org, David Given <dg@cowlark.com>
Subject: [PATCH 09/15] Handle a terminal -o option properly.
Date: Mon, 15 Dec 2008 03:27:02 +0300	[thread overview]
Message-ID: <20081215002702.16107.31316.stgit@zaytsev.su> (raw)
In-Reply-To: <20081215000849.16107.74332.stgit@zaytsev.su>

Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
---
 lib.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/lib.c b/lib.c
index ea40ce1..665a6b7 100644
--- a/lib.c
+++ b/lib.c
@@ -347,10 +347,13 @@ static char **handle_switch_m(char *arg, char **next)
 
 static char **handle_switch_o(char *arg, char **next)
 {
-	if (!strcmp (arg, "o") && *next)
-		return next + 1; // "-o foo"
-	else
-		return next;     // "-ofoo" or (bogus) terminal "-o"
+	if (!strcmp (arg, "o")) {       // "-o foo"
+		if (!*++next)
+			die("argument to '-o' is missing");
+	}
+	// else "-ofoo"
+
+	return next;
 }
 
 static const struct warning {


  parent reply	other threads:[~2008-12-15  0:17 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-15  0:25 [PATCH 00/15] Trivial sparse patches Alexey Zaytsev
2008-12-15  0:25 ` [PATCH 01/15] Evaluate iterator symbols Alexey Zaytsev
2008-12-15  0:26 ` [PATCH 02/15] Unhardcode byte size being 8 bits Alexey Zaytsev
2008-12-15  0:26 ` [PATCH 03/15] Add type information to struct instruction Alexey Zaytsev
2008-12-23  3:21   ` Christopher Li
2008-12-23  4:46     ` Alexey Zaytsev
2008-12-23  5:38       ` Christopher Li
2008-12-23 11:23     ` David Given
2008-12-24  3:09       ` Christopher Li
2008-12-24 23:01         ` David Given
2008-12-24 23:27           ` Christopher Li
2008-12-24  4:53       ` Alexey Zaytsev
2008-12-15  0:26 ` [PATCH 04/15] Replace the -specs cgcc option with -target Alexey Zaytsev
2008-12-15  0:26 ` [PATCH 05/15] Remove pre_buffer Alexey Zaytsev
2008-12-15  0:26 ` [PATCH 06/15] Sparc64 (Sparc V9, LP64) support Alexey Zaytsev
2008-12-15  0:26 ` [PATCH 07/15] OpenBSD support Alexey Zaytsev
2008-12-15  0:26 ` [PATCH 08/15] Make show_symbol newline-consistent Alexey Zaytsev
2008-12-15  0:27 ` Alexey Zaytsev [this message]
2008-12-15  0:27 ` [PATCH 10/15] Looks more evident this way Alexey Zaytsev
2008-12-15  0:27 ` [PATCH 11/15] Mark handle_switch as static and don't export it from lib.h Alexey Zaytsev
2008-12-15  0:27 ` [PATCH 12/15] Handle missing argument to -D Alexey Zaytsev
2008-12-15  0:27 ` [PATCH 13/15] Gdb macros to get a better look at some sparse data structures Alexey Zaytsev
2008-12-15  0:27 ` [PATCH 14/15] A slightly edited irc discussion with Josh Triplett Alexey Zaytsev
2008-12-15  0:27 ` [PATCH 15/15] Warning should be enough for an unhandled transparent union Alexey Zaytsev

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=20081215002702.16107.31316.stgit@zaytsev.su \
    --to=alexey.zaytsev@gmail.com \
    --cc=blauwirbel@gmail.com \
    --cc=dg@cowlark.com \
    --cc=josh@kernel.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=sparse@chrisli.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;
as well as URLs for NNTP newsgroup(s).