tPass old file name to GetOpenFileName if it is non-NULL. - vaccinewars - be a … | |
git clone git://src.adamsgaard.dk/vaccinewars | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 70816929c3600588b49fe43ccae0ac579719a84f | |
parent 35f822749aa9f3d6331d8327f721d55d7f748eef | |
Author: Ben Webb <[email protected]> | |
Date: Mon, 2 Sep 2002 13:44:03 +0000 | |
Pass old file name to GetOpenFileName if it is non-NULL. | |
Diffstat: | |
M src/gtkport/gtkport.c | 6 ++++++ | |
1 file changed, 6 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/src/gtkport/gtkport.c b/src/gtkport/gtkport.c | |
t@@ -5217,6 +5217,12 @@ gchar *GtkGetFile(const GtkWidget *parent, const gchar … | |
OPENFILENAME ofn; | |
char file[800]; | |
+ if (oldname) { | |
+ strncpy(file, oldname, sizeof(file)); | |
+ file[sizeof(file) - 1] = '\0'; | |
+ } else { | |
+ file[0] = '\0'; | |
+ } | |
ofn.lStructSize = sizeof(OPENFILENAME); | |
ofn.hwndOwner = parent ? parent->hWnd : NULL; | |
ofn.hInstance = NULL; |