summaryrefslogtreecommitdiff
path: root/crashrep/source/win32/soreport.cpp
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2006-08-29 12:32:27 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2006-08-29 12:32:27 +0000
commitf1394861f4d8ca3702b31f6f4cd4adfabb2379ee (patch)
tree814df586836f22701ebd6f7e0b523e9dd5a8e4bf /crashrep/source/win32/soreport.cpp
parent5bcfe043e2a2a548351f53835d99cf360b67f491 (diff)
INTEGRATION: CWS hro08 (1.19.8); FILE MERGED
2006/08/28 09:11:49 hro 1.19.8.1: #i64352# _wfopen does not work on Win9x with dynamically linked CRT
Diffstat (limited to 'crashrep/source/win32/soreport.cpp')
-rwxr-xr-xcrashrep/source/win32/soreport.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/crashrep/source/win32/soreport.cpp b/crashrep/source/win32/soreport.cpp
index b78d7d34eb0c..22c67729e361 100755
--- a/crashrep/source/win32/soreport.cpp
+++ b/crashrep/source/win32/soreport.cpp
@@ -4,9 +4,9 @@
*
* $RCSfile: soreport.cpp,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: hr $ $Date: 2006-06-19 14:31:42 $
+ * last change: $Author: ihi $ $Date: 2006-08-29 13:32:27 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -132,6 +132,26 @@ bool g_bLoadReport = false;
// tmpfile from msvcrt creates the temporary file in the root of the current
// volume and can fail.
+static FILE *_xfopen( const _TCHAR *file, const _TCHAR *mode )
+{
+#ifdef UNICODE
+ if ( (LONG)GetVersion() < 0 )
+ {
+ char afile[MAX_PATH];
+ char amode[16];
+
+ WideCharToMultiByte( CP_ACP, 0, file, -1, afile, MAX_PATH, NULL, NULL );
+ WideCharToMultiByte( CP_ACP, 0, mode, -1, amode, 16, NULL, NULL );
+
+
+ return fopen( afile, amode );
+ }
+ else
+#endif
+ return _tfopen( file, mode );
+}
+
+
static FILE *_tmpfile(void)
{
FILE *fp = NULL;
@@ -203,7 +223,7 @@ static FILE *_open_reportfile( LPCTSTR lpExt, LPCTSTR lpMode )
_tcscat( szAppDataPath, _T("\\crashdat") );
_tcscat( szAppDataPath, lpExt );
- fp = _tfopen( szAppDataPath, lpMode );
+ fp = _xfopen( szAppDataPath, lpMode );
}
return fp;
@@ -420,7 +440,7 @@ void CrashReportParams::ReadFromEnvironment()
if ( dwResult && dwResult < elementsof(szBuffer) )
{
- FILE *fp = _tfopen( szBuffer, _T("rb") );
+ FILE *fp = _xfopen( szBuffer, _T("rb") );
if ( fp )
{