From 154d5f43f7a6633a4937499039fc1b1b713e0c0c Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 15 Jul 2012 00:40:23 +0300 Subject: [PATCH] Check that the option actually has a short name --- source/core/getopt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/core/getopt.cpp b/source/core/getopt.cpp index 911b673..766b858 100644 --- a/source/core/getopt.cpp +++ b/source/core/getopt.cpp @@ -21,7 +21,7 @@ GetOpt::OptBase &GetOpt::add_option(OptBase *opt) { for(list::iterator i=opts.begin(); i!=opts.end(); ) { - if((*i)->get_short()==opt->get_short() || (*i)->get_long()==opt->get_long()) + if((opt->get_short()!=0 && (*i)->get_short()==opt->get_short()) || (*i)->get_long()==opt->get_long()) { delete *i; opts.erase(i++); -- 2.45.2