From: Keith F. <ven...@us...> - 2002-09-20 09:13:17
|
Update of /cvsroot/planeshift/planeshift/src/common/util In directory usw-pr-cvs1:/tmp/cvs-serv10343 Modified Files: psxmlparser.cpp Log Message: Fix for short attribute names. Index: psxmlparser.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/common/util/psxmlparser.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** psxmlparser.cpp 1 Jul 2002 02:49:27 -0000 1.13 --- psxmlparser.cpp 20 Sep 2002 09:13:14 -0000 1.14 *************** *** 121,125 **** void psXMLTag::GetTagParm(const char* parm, csString& value ) { ! xmlString param(parm); int start = FindSubString(param, 0, true); --- 121,128 ---- void psXMLTag::GetTagParm(const char* parm, csString& value ) { ! xmlString param(" "); ! param.Append(parm); ! param.Append('='); ! int start = FindSubString(param, 0, true); *************** *** 139,172 **** { start += param.Length(); ! ! // Skip whitespace after parm name ! while (Data[start]==' ') ! { ! start++; ! if (start >= (int) Length()) ! return; ! } ! if (Data[start] != '=') ! continue; ! ! start++; // skip = sign ! if (start >= (int) Length()) ! return; ! // skip whitespace after parm name while (Data[start]==' ') ! { start++; ! if (start >= (int) Length()) ! return; ! } ! size_t end = start+1; // parm is at least one char ! // Determine delimiter, if any char chr; ! if ( Data[start] == '\"') ! chr = '\"'; else if ( Data[start] == '[') chr = ']'; --- 142,164 ---- { start += param.Length(); ! ! if (start >= (int) Length()) ! return; ! // skip whitespace after parm name while (Data[start]==' ') ! { start++; ! if (start >= (int) Length()) ! return; ! } ! size_t end = start+1; // parm is at least one char ! // Determine delimiter, if any char chr; ! if ( Data[start] == '\"') ! chr = '\"'; else if ( Data[start] == '[') chr = ']'; *************** *** 175,191 **** else chr = ' '; ! while ( end < Length() && Data[end]!=chr && Data[end] != '>') end++; ! GetSubString(tempStr, start+(chr!=' '), end); ! // Replace any xml code with the correct '&' csString what = "&"; csString with = "&"; ! while (tempStr.FindSubString(what) != -1) tempStr.ReplaceSubString(what,with); ! value = tempStr; return; --- 167,183 ---- else chr = ' '; ! while ( end < Length() && Data[end]!=chr && Data[end] != '>') end++; ! GetSubString(tempStr, start+(chr!=' '), end); ! // Replace any xml code with the correct '&' csString what = "&"; csString with = "&"; ! while (tempStr.FindSubString(what) != -1) tempStr.ReplaceSubString(what,with); ! value = tempStr; return; |