projects
/
libs
/
core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bdab2ba
)
Check that the option actually has a short name
author
Mikko Rasa
<tdb@tdb.fi>
Sat, 14 Jul 2012 21:40:23 +0000
(
00:40
+0300)
committer
Mikko Rasa
<tdb@tdb.fi>
Sat, 14 Jul 2012 21:40:23 +0000
(
00:40
+0300)
source/core/getopt.cpp
patch
|
blob
|
history
diff --git
a/source/core/getopt.cpp
b/source/core/getopt.cpp
index 911b673d9b1d28358966a302de44aaf6428735e3..766b858e8d4aa4b2212b94f51756cad0a07a964b 100644
(file)
--- a/
source/core/getopt.cpp
+++ b/
source/core/getopt.cpp
@@
-21,7
+21,7
@@
GetOpt::OptBase &GetOpt::add_option(OptBase *opt)
{
for(list<OptBase *>::iterator i=opts.begin(); i!=opts.end(); )
{
{
for(list<OptBase *>::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++);
{
delete *i;
opts.erase(i++);