From ebeffecaed56eb31ccf42d53e883714ecf863a90 Mon Sep 17 00:00:00 2001 From: "davidmc%netscape.com" Date: Tue, 20 Apr 1999 20:33:56 +0000 Subject: [PATCH] continue long values using \linebreak notation; this is done in conjunction with a change to morkParser::ReadValue() which will correctly interpret this notation. Note this is technically a format change in the sense that old versions of Mork will not read such line continuations correctly; but the change is forward compatible so folks should not notice. git-svn-id: svn://10.0.0.236/trunk@28307 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/db/mork/src/morkWriter.cpp | 9 ++++++++- mozilla/mailnews/db/mork/src/morkWriter.cpp | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/mozilla/db/mork/src/morkWriter.cpp b/mozilla/db/mork/src/morkWriter.cpp index aa011b26ca3..0f2c4ba2274 100644 --- a/mozilla/db/mork/src/morkWriter.cpp +++ b/mozilla/db/mork/src/morkWriter.cpp @@ -356,6 +356,7 @@ morkWriter::WriteYarn(morkEnv* ev, const mdbYarn* inYarn) // than the entire yarn's size, since only part goes on a last line). { mork_size outSize = 0; + mork_size lineSize = mWriter_LineSize; morkStream* stream = mWriter_Stream; const mork_u1* b = (const mork_u1*) inYarn->mYarn_Buf; @@ -364,8 +365,14 @@ morkWriter::WriteYarn(morkEnv* ev, const mdbYarn* inYarn) register int c; mork_fill fill = inYarn->mYarn_Fill; const mork_u1* end = b + fill; - while ( b < end ) + while ( b < end && ev->Good() ) { + if ( lineSize + outSize >= mWriter_MaxLine ) // continue line? + { + stream->PutByteThenNewline(ev, '\\'); + mWriter_LineSize = lineSize = outSize = 0; + } + c = *b++; // next byte to print if ( morkCh_IsValue(c) ) { diff --git a/mozilla/mailnews/db/mork/src/morkWriter.cpp b/mozilla/mailnews/db/mork/src/morkWriter.cpp index aa011b26ca3..0f2c4ba2274 100644 --- a/mozilla/mailnews/db/mork/src/morkWriter.cpp +++ b/mozilla/mailnews/db/mork/src/morkWriter.cpp @@ -356,6 +356,7 @@ morkWriter::WriteYarn(morkEnv* ev, const mdbYarn* inYarn) // than the entire yarn's size, since only part goes on a last line). { mork_size outSize = 0; + mork_size lineSize = mWriter_LineSize; morkStream* stream = mWriter_Stream; const mork_u1* b = (const mork_u1*) inYarn->mYarn_Buf; @@ -364,8 +365,14 @@ morkWriter::WriteYarn(morkEnv* ev, const mdbYarn* inYarn) register int c; mork_fill fill = inYarn->mYarn_Fill; const mork_u1* end = b + fill; - while ( b < end ) + while ( b < end && ev->Good() ) { + if ( lineSize + outSize >= mWriter_MaxLine ) // continue line? + { + stream->PutByteThenNewline(ev, '\\'); + mWriter_LineSize = lineSize = outSize = 0; + } + c = *b++; // next byte to print if ( morkCh_IsValue(c) ) {