cmPgmOpt.c: Changed _cmPgmOptInsertArg() to add args to the end of the option and mater lists.

This commit is contained in:
kevin 2013-03-02 17:06:09 -08:00
parent 18fc1b0a12
commit 79fde062cd

View File

@ -479,11 +479,23 @@ _cmPoArg_t* _cmPgmOptInsertArg( _cmPo_t* p, _cmPoOpt_t* r )
a->opt = r;
a->valStr = NULL;
a->link = p->args; // link into master arg list
// link onto the end of the master arg list
_cmPoArg_t* ap = p->args;
while( ap!=NULL && ap->link != NULL )
ap=ap->link;
if( ap == NULL )
p->args = a;
else
ap->link = a;
a->inst = r->inst; // link into opt recd list
// link onto the end of the opt recd list
ap = r->inst;
while( ap!=NULL && ap->inst!=NULL)
ap=ap->inst;
if( ap==NULL)
r->inst = a;
else
ap->inst = a;
// if no parm. type flag was given then the arg is implicitely a bool and the value is true.
//if( (r->flags & kTypeMaskPoFl) == 0 )