aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-07-31 00:41:06 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-07-31 00:41:06 +0200
commit907ac2de82986cbb6bdc1e5f5b7fcbe35f8775fe (patch)
tree1c9b485c7bb05afb4c23ae25887ff1a3edd7dcb9
parente1bba1a903581fe7f7fa187e76bf37bf96efde7a (diff)
parentb5b4cd3e13db117d593b50b432133847554adfc4 (diff)
downloadsparse-907ac2de82986cbb6bdc1e5f5b7fcbe35f8775fe.tar.gz
Merge branch 'undef-option'
-rw-r--r--options.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/options.c b/options.c
index a2e15bb7..f7e81b84 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;
}