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