Browse Source

fixed kdenetwork (kmime / kmail) mostly for big-endian systems

git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@2038 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc
rocklinux
Rene Rebe 21 years ago
parent
commit
e226f652f8
3 changed files with 163 additions and 0 deletions
  1. +4
    -0
      Documentation/Developers/CHANGELOG-RENE
  2. +103
    -0
      package/kde31/kdenetwork31/kmime_codec_qp.cpp.patch
  3. +56
    -0
      package/kde31/kdenetwork31/kmime_codec_qp.h.patch

+ 4
- 0
Documentation/Developers/CHANGELOG-RENE

@ -1,4 +1,8 @@
*) 2003-12-22 (2.0.0-rc3 - 2.0.0-rc4)
- fixed kdenetwork (kmime / kmail) mostly for big-endian systems
*) 2003-12-21 (2.0.0-rc3 - 2.0.0-rc4)
- added powerpc kernel26 disable list

+ 103
- 0
package/kde31/kdenetwork31/kmime_codec_qp.cpp.patch

@ -0,0 +1,103 @@
Use of tainted arguments in exec is deprecated at /var/www/cgi-bin/cvsweb.cgi line 2043.
===================================================================
RCS file: /home2/webcvs/mirror/kdepim/libkdenetwork/kmime_codec_qp.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -p -r1.12 -r1.13
--- kdepim/libkdenetwork/kmime_codec_qp.cpp 2003/07/26 14:51:52 1.12
+++ kdepim/libkdenetwork/kmime_codec_qp.cpp 2003/10/30 14:15:30 1.13
@@ -189,6 +189,20 @@ public:
bool finish( char* & dcursor, const char * const dend );
};
+// this doesn't access any member variables, so it can be defined static
+// but then we can't call it from virtual functions
+static int QuotedPrintableDecoder_maxDecodedSizeFor( int insize, bool withCRLF ) {
+ // all chars unencoded:
+ int result = insize;
+ // but maybe all of them are \n and we need to make them \r\n :-o
+ if ( withCRLF )
+ result += insize;
+
+ // there might be an accu plus escape
+ result += 2;
+
+ return result;
+}
Encoder * QuotedPrintableCodec::makeEncoder( bool withCRLF ) const {
return new QuotedPrintableEncoder( withCRLF );
@@ -198,6 +212,10 @@ Decoder * QuotedPrintableCodec::makeDeco
return new QuotedPrintableDecoder( withCRLF );
}
+int QuotedPrintableCodec::maxDecodedSizeFor( int insize, bool withCRLF ) const {
+ return QuotedPrintableDecoder_maxDecodedSizeFor(insize, withCRLF);
+}
+
Encoder * Rfc2047QEncodingCodec::makeEncoder( bool withCRLF ) const {
return new Rfc2047QEncodingEncoder( withCRLF );
}
@@ -206,6 +224,10 @@ Decoder * Rfc2047QEncodingCodec::makeDec
return new QuotedPrintableDecoder( withCRLF, true );
}
+int Rfc2047QEncodingCodec::maxDecodedSizeFor( int insize, bool withCRLF ) const {
+ return QuotedPrintableDecoder_maxDecodedSizeFor(insize, withCRLF);
+}
+
Encoder * Rfc2231EncodingCodec::makeEncoder( bool withCRLF ) const {
return new Rfc2047QEncodingEncoder( withCRLF, '%' );
}
@@ -214,12 +236,14 @@ Decoder * Rfc2231EncodingCodec::makeDeco
return new QuotedPrintableDecoder( withCRLF, true, '%' );
}
+int Rfc2231EncodingCodec::maxDecodedSizeFor( int insize, bool withCRLF ) const {
+ return QuotedPrintableDecoder_maxDecodedSizeFor(insize, withCRLF);
+}
/********************************************************/
/********************************************************/
/********************************************************/
-
bool QuotedPrintableDecoder::decode( const char* & scursor, const char * const send,
char* & dcursor, const char * const dend ) {
if ( mWithCRLF )
@@ -402,7 +426,7 @@ bool QuotedPrintableEncoder::processNext
bufferFill += 16;
assert( bufferFill >=0 && bufferFill <= 15 );
-
+
if ( !mFinishing && !mSawLineEnd &&
bufferFill < minBufferFillWithoutLineEnd )
return false;
@@ -424,7 +448,7 @@ bool QuotedPrintableEncoder::processNext
else
// never needs encoding
mAccuNeedsEncoding = Never;
-
+
return true;
}
@@ -485,7 +509,7 @@ bool QuotedPrintableEncoder::encode( con
// fill input buffer until eol has been reached or until the
// buffer is full, whatever comes first:
fillInputBuffer( scursor, send );
-
+
if ( processNextChar() )
// there was one...
createOutputBuffer( dcursor, dend );
@@ -506,7 +530,7 @@ bool QuotedPrintableEncoder::encode( con
if ( mOutputBufferCursor ) flushOutputBuffer( dcursor, dend );
return (scursor == send);
-
+
} // encode
bool QuotedPrintableEncoder::finish( char* & dcursor,

+ 56
- 0
package/kde31/kdenetwork31/kmime_codec_qp.h.patch

@ -0,0 +1,56 @@
Use of tainted arguments in exec is deprecated at /var/www/cgi-bin/cvsweb.cgi line 2043.
===================================================================
RCS file: /home2/webcvs/mirror/kdepim/libkdenetwork/kmime_codec_qp.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- kdepim/libkdenetwork/kmime_codec_qp.h 2003/07/26 14:51:52 1.4
+++ kdepim/libkdenetwork/kmime_codec_qp.h 2003/10/30 14:15:30 1.5
@@ -54,19 +54,11 @@ public:
int result = 3*insize;
// then after 25 hexchars comes a soft linebreak: =(\r)\n
result += (withCRLF ? 3 : 2) * (insize/25);
-
+
return result;
}
- int maxDecodedSizeFor( int insize, bool withCRLF=false ) const {
- // all chars unencoded:
- int result = insize;
- // but maybe all of them are \n and we need to make them \r\n :-o
- if ( withCRLF )
- result += insize;
-
- return result;
- }
+ int maxDecodedSizeFor( int insize, bool withCRLF=false ) const;
Encoder * makeEncoder( bool withCRLF=false ) const;
Decoder * makeDecoder( bool withCRLF=false ) const;
@@ -92,11 +84,7 @@ public:
return 3*insize;
}
- int maxDecodedSizeFor( int insize, bool withCRLF=false ) const {
- (void)withCRLF; // keep compiler happy
- // equally simple: nothing is encoded at all, so:
- return insize;
- }
+ int maxDecodedSizeFor( int insize, bool withCRLF=false ) const;
Encoder * makeEncoder( bool withCRLF=false ) const;
Decoder * makeDecoder( bool withCRLF=false ) const;
@@ -121,11 +109,7 @@ public:
return 3*insize;
}
- int maxDecodedSizeFor( int insize, bool withCRLF=false ) const {
- (void)withCRLF; // keep compiler happy
- // same as for "q" encoding:
- return insize;
- }
+ int maxDecodedSizeFor( int insize, bool withCRLF=false ) const;
Encoder * makeEncoder( bool withCRLF=false ) const;
Decoder * makeDecoder( bool withCRLF=false ) const;

Loading…
Cancel
Save