SF.net SVN: geany:[3871] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Wed Jun 17 18:18:46 UTC 2009


Revision: 3871
          http://geany.svn.sourceforge.net/geany/?rev=3871&view=rev
Author:   eht16
Date:     2009-06-17 18:18:46 +0000 (Wed, 17 Jun 2009)

Log Message:
-----------
Prevent possible crash on Windows when not setting an initial directory for native File Open/Save dialogs.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/win32.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-06-17 11:17:07 UTC (rev 3870)
+++ trunk/ChangeLog	2009-06-17 18:18:46 UTC (rev 3871)
@@ -1,3 +1,9 @@
+2009-06-17  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>
+
+ * src/win32.c:
+   Prevent possible crash on Windows when not setting an initial
+   directory for native File Open/Save dialogs.
+
 2009-06-17  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
 
  * src/filetypes.h, src/document.c, src/document.h, src/ui_utils.c:

Modified: trunk/src/win32.c
===================================================================
--- trunk/src/win32.c	2009-06-17 11:17:07 UTC (rev 3870)
+++ trunk/src/win32.c	2009-06-17 18:18:46 UTC (rev 3871)
@@ -324,7 +324,8 @@
 
 	fname[0] = '\0';
 
-	MultiByteToWideChar(CP_UTF8, 0, initial_dir, -1, w_dir, sizeof(w_dir));
+	if (initial_dir != NULL)
+		MultiByteToWideChar(CP_UTF8, 0, initial_dir, -1, w_dir, sizeof(w_dir));
 
 	/* initialise file dialog info struct */
 	memset(&of, 0, sizeof of);
@@ -339,7 +340,7 @@
 	of.lpstrCustomFilter = NULL;
 	of.nFilterIndex = GEANY_FILETYPES_NONE + 1;
 	of.lpstrFile = fname;
-	of.lpstrInitialDir = w_dir;
+	of.lpstrInitialDir = (initial_dir != NULL) ? w_dir : NULL;
 	of.nMaxFile = 2048;
 	of.lpstrFileTitle = NULL;
 	of.lpstrTitle = NULL;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list