From 3138002a1f69294b8f5f9ec0ed6d7d535fbc3f05 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Mon, 9 Jan 2017 23:39:30 -0500 Subject: [PATCH] main: ArgList would silently drop the first argument This fixes a bug where bees tries to process itself as a btrfs filesystem. This is a species of bug that I only notice *after* pushing to a public git repo. Signed-off-by: Zygo Blaxell --- src/bees.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bees.cc b/src/bees.cc index 519a3ac..165188e 100644 --- a/src/bees.cc +++ b/src/bees.cc @@ -555,7 +555,8 @@ BeesTempFile::make_copy(const BeesFileRange &src) int bees_main(int argc, const char **argv) { - vector args(argv, argv + argc); + THROW_CHECK1(invalid_argument, argc, argc >= 1); + vector args(argv + 1, argv + argc - 1); set_catch_explainer([&](string s) { BEESLOG("\n\n*** EXCEPTION ***\n\t" << s << "\n***\n");