[vlc-commits] Win32: rename crashdump to get only 1 bug report

Hannes Domani git at videolan.org
Fri Aug 15 06:07:57 CEST 2014


vlc | branch: master | Hannes Domani <ssbssa at yahoo.de> | Wed Aug 13 20:09:20 2014 +0200| [8b0f5764e8ecda6cebef43fdd852f37abb15cc5d] | committer: Jean-Baptiste Kempf

Win32: rename crashdump to get only 1 bug report

Close #8168

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8b0f5764e8ecda6cebef43fdd852f37abb15cc5d
---

 bin/winvlc.c |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/bin/winvlc.c b/bin/winvlc.c
index 02bc5b6..3209b46 100644
--- a/bin/winvlc.c
+++ b/bin/winvlc.c
@@ -207,7 +207,14 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
 /* Crashdumps handling */
 static void check_crashdump(void)
 {
-    FILE * fd = _wfopen ( crashdump_path, L"r, ccs=UTF-8" );
+    wchar_t mv_crashdump_path[MAX_PATH];
+    wcscpy (mv_crashdump_path, crashdump_path);
+    wcscat (mv_crashdump_path, L".mv");
+
+    if (_wrename (crashdump_path, mv_crashdump_path))
+        return;
+
+    FILE * fd = _wfopen ( mv_crashdump_path, L"r, ccs=UTF-8" );
     if( !fd )
         return;
     fclose( fd );
@@ -235,7 +242,7 @@ static void check_crashdump(void)
                         now.wYear, now.wMonth, now.wDay, now.wHour,
                         now.wMinute, now.wSecond );
 
-                if( FtpPutFile( ftp, crashdump_path, remote_file,
+                if( FtpPutFile( ftp, mv_crashdump_path, remote_file,
                             FTP_TRANSFER_TYPE_BINARY, 0) )
                     MessageBox( NULL, L"Report sent correctly. Thanks a lot " \
                                 "for the help.", L"Report sent", MB_OK);
@@ -265,7 +272,7 @@ static void check_crashdump(void)
         }
     }
 
-    _wremove(crashdump_path);
+    _wremove(mv_crashdump_path);
 }
 
 /*****************************************************************************



More information about the vlc-commits mailing list