threads / patch / 50464

patchprune-packed: check for too many arguments

Subject: [PATCH] prune-packed: check for too many arguments

## tl;dr

One message between Feb 11, 2019 and Feb 11, 2019. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Ramsay Jones· Feb 11, 2019, 17:23 UTC · lore
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---
Hi Junio,

Another 'old find' (from feb 2017), but this time I don't seem to have sent this one to the list before. It is possible that I didn't think it was up to scratch ... dunno. ;-)

ATB, Ramsay Jones

 builtin/prune-packed.c | 5 +++++
 1 file changed, 5 insertions(+)
Show changes to builtin/prune-packed.c +5 −0
diff --git a/builtin/prune-packed.c b/builtin/prune-packed.c
index a9e7b552b9..48c5e78e33 100644
--- a/builtin/prune-packed.c
+++ b/builtin/prune-packed.c
@@ -63,6 +63,11 @@ int cmd_prune_packed(int argc, const char **argv, const char *prefix)
 	argc = parse_options(argc, argv, prefix, prune_packed_options,
 			     prune_packed_usage, 0);
 
+	if (argc > 0)
+		usage_msg_opt(_("too many arguments"),
+			      prune_packed_usage,
+			      prune_packed_options);
+
 	prune_packed_objects(opts);
 	return 0;
 }
-- 
2.20.0

← back to recent threads