Linux-Sparse Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] option: accept 'sparse -U ...'
@ 2020-07-22 21:28 Luc Van Oostenryck
  0 siblings, 0 replies; only message in thread
From: Luc Van Oostenryck @ 2020-07-22 21:28 UTC (permalink / raw)
  To: linux-sparse; +Cc: Luc Van Oostenryck

The '-D' flag was fixed to accept whitespace before the argument
but the '-U' flag wasn't. So, fix this now.

Fixes: 7f1011b311e9329f53d73f88de495ea64071eb77
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 options.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/options.c b/options.c
index a2e15bb75c0d..f7e81b84d749 100644
--- a/options.c
+++ b/options.c
@@ -782,6 +782,12 @@ static char **handle_switch_s(const char *arg, char **next)
 static char **handle_switch_U(char *arg, char **next)
 {
 	const char *name = arg + 1;
+
+	if (*name == '\0') {
+		name = *++next;
+		if (!name)
+			die("argument to `-U' is missing");
+	}
 	add_pre_buffer("#undef %s\n", name);
 	return next;
 }
-- 
2.27.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-22 21:28 [PATCH] option: accept 'sparse -U ...' Luc Van Oostenryck

Linux-Sparse Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-sparse/0 linux-sparse/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-sparse linux-sparse/ https://lore.kernel.org/linux-sparse \
		linux-sparse@vger.kernel.org
	public-inbox-index linux-sparse

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-sparse


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git