summaryrefslogtreecommitdiff
path: root/l10ntools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-12-16 14:55:22 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-12-21 10:10:56 +0000
commit4eb4514ee1690b43c8abf091a8ee4591383388da (patch)
tree50ae75c744162ce026209b6cbe46dd5f08aeef8a /l10ntools
parentc1c3ef64bca25183979f666aef51ab2854d628d8 (diff)
This just can't be right, WriteByteString writes a pascal-style string
WriteLine just writes a line of text, WriteByteString writes a 16bit length of following content. It can't make sense to suddenly stick a pascal-style string in at the end of a file that's otherwise plain text. original git id that introduced the use of WriteByteString here was ea76474a back in 2002 Perhaps this worked because partial strings never ended up as trailing content, so only ever had an empty string as the final partial string, so a 0x0000 got appended, as opposed to a newline, so it appeared to do the right thing.
Diffstat (limited to 'l10ntools')
-rw-r--r--l10ntools/source/export2.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/l10ntools/source/export2.cxx b/l10ntools/source/export2.cxx
index 873f39c9e469..2944627521d7 100644
--- a/l10ntools/source/export2.cxx
+++ b/l10ntools/source/export2.cxx
@@ -429,13 +429,13 @@ sal_Bool Export::ConvertLineEnds(
while ( !aSource.IsEof())
{
aSource.ReadLine( sLine );
- if ( !aSource.IsEof())
+ if ( !aSource.IsEof()) //a complete line
{
sLine = comphelper::string::remove(sLine, '\r');
aDestination.WriteLine( sLine );
}
- else
- aDestination.WriteByteString( sLine );
+ else //a final incomplete line, just copy it as-is
+ aDestination.Write( sLine.getStr(), sLine.getLength() );
}
aSource.Close();