[Gtkradiant] [Bug 744] New: crash in open / load dialog
gtkradiant@zerowing.idsoftware.com
gtkradiant@zerowing.idsoftware.com
Sat, 18 Jan 2003 08:29:27 -0600
http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=744
Summary: crash in open / load dialog
Product: GtkRadiant
Version: 1.3
Platform: All
OS/Version: MacOS X
Status: NEW
Severity: normal
Priority: P2
Component: editor
AssignedTo: ttimo@idsoftware.com
ReportedBy: champoux@attbi.com
When you press enter without choosing a map file, Radiant will crash. First reported by P4.
Index: radiant/mainframe.cpp
===================================================================
RCS file: /cvs/GtkRadiant/radiant/mainframe.cpp,v
retrieving revision 1.101.2.9
diff -u -r1.101.2.9 mainframe.cpp
--- radiant/mainframe.cpp 23 Dec 2002 23:00:18 -0000 1.101.2.9
+++ radiant/mainframe.cpp 15 Jan 2003 08:00:42 -0000
@@ -4261,6 +4261,11 @@
if (str != NULL)
{
+ if (str[strlen(str) - 1] == G_DIR_SEPARATOR)
+ {
+ return; // crashes on Darwin otherwise.
+ }
+
strcpy(currentmap,str);
MRU_AddFile (str);
Map_LoadFile(str);
@@ -4279,6 +4284,11 @@
if (str != NULL)
{
+ if (str[strlen(str) - 1] == G_DIR_SEPARATOR)
+ {
+ return; // crashes on Darwin otherwise.
+ }
+
Map_ImportFile(str);
}
}