From 0bd988e2df073e9448bfe0444692e75fe574697f Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 11 Feb 2016 19:22:43 -0500 Subject: [PATCH] cmXml.c : Fixed bug in _cmXmlNoteHasChildWithAttrAndValue(). --- cmXml.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmXml.c b/cmXml.c index d030321..6d465bc 100644 --- a/cmXml.c +++ b/cmXml.c @@ -1063,7 +1063,7 @@ bool cmXmlNodeHasChild( const cmXmlNode_t* np, const cmChar_t* label, ... ) bool _cmXmlNodeHasChildWithAttrAndValueV( const cmXmlNode_t* np, const cmChar_t* label, va_list vl0, bool valueFl ) { unsigned argN = _cmXmlLabelCount(label,vl0); - unsigned n = valueFl ? 2 : 1; + unsigned n = valueFl ? 2 : 1; va_list vl1; unsigned i; @@ -1072,15 +1072,17 @@ bool _cmXmlNodeHasChildWithAttrAndValueV( const cmXmlNode_t* np, const cmChar if( argN <= n-1 ) return false; + argN -= n; + va_copy(vl1,vl0); - np = _cmXmlNodeHasChildV(np,label,vl1,argN-1); + np = _cmXmlNodeHasChildV(np,label,vl1,argN); va_end(vl1); if( np == NULL ) return false; - + // advance vl0 to the attribute label - for(i=0; i