Update of /cvsroot/mahogany/M/src/modules/viewflt
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4647/src/modules/viewflt
Modified Files:
UUDecode.cpp
Log Message:
- Fix a crashing bug when there is no data to UUdecode
- Don't display warnings about UUdecoding in release
Index: UUDecode.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/modules/viewflt/UUDecode.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -b -u -2 -r1.3 -r1.4
--- UUDecode.cpp 14 May 2004 08:14:21 -0000 1.3
+++ UUDecode.cpp 14 May 2004 08:37:36 -0000 1.4
@@ -283,5 +283,7 @@
&& start[3] == ' ' ) )
{
+#if defined(__WXDEBUG__)
wxLogWarning(_("The BEGIN line is not correctly formed."));
+#endif
continue;
}
@@ -302,4 +304,6 @@
const wxChar* endOfEncodedStream = 0;
bool ok = UUdecodeFile(start_data, decodedFile, &endOfEncodedStream);
+ if ( ok )
+ {
if ( endOfEncodedStream[0] == '\r' &&
endOfEncodedStream[1] == '\n' &&
@@ -310,7 +314,4 @@
endOfEncodedStream += 5;
}
- if ( ok )
- {
-
// output the part before the BEGIN line, if any
String prolog(nextToOutput, startBeginLine-2);
@@ -320,6 +321,5 @@
}
-#if 1
- // Let's get a fileType
+ // Let's get a mimeType from the extention
wxFileType *fileType =
mApplication->GetMimeManager().GetFileTypeFromExtension(fileName.AfterLast('.'));
String mimeType;
@@ -331,14 +331,14 @@
MimePartRaw* decodedMime =
new MimePartRaw(fileName, mimeType, decodedFile, _T("uuencoded"));
-
m_msgView->ShowPart(decodedMime);
-#else
- viewer->InsertText(_T("UUencoded file named \""), style);
- viewer->InsertText(fileName, style);
- viewer->InsertText(_T("\"\n"), style);
-#endif
nextToOutput = start = endOfEncodedStream;
}
+ else
+ {
+#if defined(__WXDEBUG__)
+ wxLogWarning(_("This message seems to contain uuencoded data, but in fact it
does not."));
+#endif
+ }
}
String prolog(nextToOutput);
-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates