cmPrefs.h/c Check existsFl prior to signaling kDuplicateIdPrRC error in _cmPrefsCreateJsonNode().
This commit is contained in:
parent
c7abab867e
commit
56e192c00e
@ -1337,8 +1337,9 @@ cmPrRC_t _cmPrefsCreateJsonNode(
|
||||
pnp->id = _cmPrefsCalcNextAvailId(p);
|
||||
else
|
||||
{
|
||||
if( _cmPrefsIdToNodePtr(p, id, false ) != NULL )
|
||||
cmErrWarnMsg(&p->err,kDuplicateIdPrRC,"The preference variable id '%i' is used by multiple preference variables including '%s'.",id,cmStringNullGuard(pathString));
|
||||
if( existsFl == false )
|
||||
if( _cmPrefsIdToNodePtr(p, id, false ) != NULL )
|
||||
cmErrWarnMsg(&p->err,kDuplicateIdPrRC,"The preference variable id '%i' is used by multiple preference variables including '%s'.",id,cmStringNullGuard(pathString));
|
||||
|
||||
pnp->id = id;
|
||||
}
|
||||
|
@ -144,8 +144,9 @@ extern "C" {
|
||||
cmPrRC_t cmPrefsPathSetString( cmPrH_t h, const cmChar_t* pathStr, const cmChar_t* val );
|
||||
|
||||
// Create a new preference variable and set it's value to 'val'.
|
||||
// If a variable with the same path and type already exists and kForceValuePrFl is set then update it's value to 'val'.
|
||||
// Note that in this case if kForceValuePrFl is not set then the function returns quietly.
|
||||
// If a variable with the same path and type already exists and kForceValuePrFl
|
||||
// is set then update it's value to 'val'. Note that in this case if
|
||||
// kForceValuePrFl is not set then the function returns quietly.
|
||||
//
|
||||
// If a variable with the same path but a different type exists then an error is returned.
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user