From 7c129cdd3830a55a8611eecf82af08cd3301f7f2 Mon Sep 17 00:00:00 2001 From: Andrew Ayer Date: Tue, 28 Apr 2020 09:14:29 -0400 Subject: [PATCH] Don't interpret a literal "-" as an option argument on command line This allows the following command to work properly: git-crypt export-key - Previously, you had to run this command, because - was being interpreted as an option argument: git-crypt export-key -- - --- parse_options.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse_options.cpp b/parse_options.cpp index 008e29d..5c80b07 100644 --- a/parse_options.cpp +++ b/parse_options.cpp @@ -43,7 +43,7 @@ int parse_options (const Options_list& options, int argc, const char** argv) { int argi = 0; - while (argi < argc && argv[argi][0] == '-') { + while (argi < argc && argv[argi][0] == '-' && argv[argi][1] != '\0') { if (std::strcmp(argv[argi], "--") == 0) { ++argi; break;