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...@locus.apache.org on 2000/09/28 16:28:32 UTC
cvs commit: xml-xalan/c/src/PlatformSupport XalanOutputStream.cpp
dbertoni 00/09/28 07:28:31
Modified: c/src/PlatformSupport XalanOutputStream.cpp
Log:
Fixed problem with writing file prolog.
Revision Changes Path
1.2 +10 -3 xml-xalan/c/src/PlatformSupport/XalanOutputStream.cpp
Index: XalanOutputStream.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/XalanOutputStream.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XalanOutputStream.cpp 2000/09/27 16:24:12 1.1
+++ XalanOutputStream.cpp 2000/09/28 14:28:30 1.2
@@ -360,14 +360,21 @@
m_encoding = theEncoding;
- const XalanTranscodingServices::XalanXMLByteVectorType theProlog =
+ typedef XalanTranscodingServices::XalanXMLByteVectorType XalanXMLByteVectorType;
+
+ const XalanXMLByteVectorType& theProlog =
XalanTranscodingServices::getStreamProlog(theEncoding);
+ const XalanXMLByteVectorType::size_type theSize = theProlog.size();
+
+ if (theSize > 0)
+ {
#if defined(XALAN_OLD_STYLE_CASTS)
- write((const char*)theProlog[0], theProlog.size());
+ write((const char*)theProlog[0], theProlog.size());
#else
- write(reinterpret_cast<const char*>(&theProlog[0]), theProlog.size());
+ write(reinterpret_cast<const char*>(&theProlog[0]), theProlog.size());
#endif
+ }
}