You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2008/03/19 18:29:50 UTC
svn commit: r638945 - /xalan/c/trunk/src/xalanc/Harness/XalanFileUtility.cpp
Author: dbertoni
Date: Wed Mar 19 10:29:49 2008
New Revision: 638945
URL: http://svn.apache.org/viewvc?rev=638945&view=rev
Log:
Fixed truncation warning by using existing XalanDOMString helper function.
Modified:
xalan/c/trunk/src/xalanc/Harness/XalanFileUtility.cpp
Modified: xalan/c/trunk/src/xalanc/Harness/XalanFileUtility.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/Harness/XalanFileUtility.cpp?rev=638945&r1=638944&r2=638945&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/Harness/XalanFileUtility.cpp (original)
+++ xalan/c/trunk/src/xalanc/Harness/XalanFileUtility.cpp Wed Mar 19 10:29:49 2008
@@ -575,19 +575,10 @@
XalanDOMString& targetFile,
bool* status)
{
- int thePeriodIndex = -1;
- const int theLength = length(theXMLFileName);
+ const size_type thePeriodIndex =
+ lastIndexOf(theXMLFileName, XalanUnicode::charFullStop);
- for (int i = theLength - 1; i > 0; i--)
- {
- if (charAt(theXMLFileName, i) == XalanUnicode::charFullStop)
- {
- thePeriodIndex = i; // charFullStop is the dot (x2E)
- break;
- }
- }
-
- if (thePeriodIndex != -1)
+ if (thePeriodIndex != XalanDOMString::npos)
{
targetFile.assign(theXMLFileName, 0, thePeriodIndex + 1);
@@ -595,7 +586,7 @@
}
// Check the .xml file exists.
- if (!strcmp(suffix,"xml"))
+ if (!strcmp(suffix, "xml"))
{
TranscodeToLocalCodePage(targetFile, m_buffer, true);
const char* const theFileName = &*m_buffer.begin();
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org