slackbuilds/games/snes9x/snes9x-fix-crash.patch

31 lines
937 B
Diff

From 6d74746342a73cf65db215f4fdecdfb0cae66792 Mon Sep 17 00:00:00 2001
From: Brandon Wright <bearoso@gmail.com>
Date: Mon, 10 Feb 2014 16:28:05 -0600
Subject: [PATCH] Fix bug caused by virtual directories.
---
gtk/src/gtk_file.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/gtk/src/gtk_file.cpp b/gtk/src/gtk_file.cpp
index a0df75d..9c0e000 100644
--- a/gtk/src/gtk_file.cpp
+++ b/gtk/src/gtk_file.cpp
@@ -465,8 +465,11 @@ S9xOpenROMDialog (void)
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
directory =
gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (dialog));
- strncpy (gui_config->last_directory, directory, PATH_MAX);
- g_free (directory);
+ if (directory)
+ {
+ strncpy (gui_config->last_directory, directory, PATH_MAX);
+ g_free (directory);
+ }
}
else
--
1.9.3