[PATCH] option: accept 'sparse -U ...'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux