Revision: 419 Author: ntrel Date: 2006-06-07 09:50:41 -0700 (Wed, 07 Jun 2006) ViewCVS: http://svn.sourceforge.net/geany/?rev=419&view=rev
Log Message: ----------- Fixed segfault when inserting comments and no filetype is set
Modified Paths: -------------- trunk/ChangeLog trunk/src/callbacks.c Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-06-06 19:06:38 UTC (rev 418) +++ trunk/ChangeLog 2006-06-07 16:50:41 UTC (rev 419) @@ -1,3 +1,9 @@ +2006-06-07 Nick Treleaven nick.treleaven@btinternet.com + + * src/callbacks.c: Fixed segfault when inserting comments and no + filetype is set. + + 2006-06-06 Enrico Troeger enrico.troeger@uvena.de
* src/highlighting.c: enabled folding for markup filetypes @@ -9,7 +15,7 @@
* doc/geany.docbook: Added save current file behaviour when building. * src/sci_cb.c: Fix empty white box glitch with tag autocompletion, - also improves typing response efficiency. + also improves typing response efficiency.
2006-06-05 Enrico Troeger enrico.troeger@uvena.de
Modified: trunk/src/callbacks.c =================================================================== --- trunk/src/callbacks.c 2006-06-06 19:06:38 UTC (rev 418) +++ trunk/src/callbacks.c 2006-06-07 16:50:41 UTC (rev 419) @@ -2020,6 +2020,12 @@ gchar *cur_tag = NULL; gint line = -1, pos = 0;
+ if (doc_list[idx].file_type == NULL) + { + msgwin_status_add(_("Please set the filetype for the current file before using this function.")); + return; + } + if (doc_list[idx].file_type->id != GEANY_FILETYPES_JAVA && doc_list[idx].file_type->id != GEANY_FILETYPES_ALL) { @@ -2064,6 +2070,12 @@ gint idx = document_get_cur_idx(); gchar *text;
+ if (doc_list[idx].file_type == NULL) + { + msgwin_status_add(_("Please set the filetype for the current file before using this function.")); + return; + } + switch (doc_list[idx].file_type->id) { case GEANY_FILETYPES_PASCAL: @@ -2098,6 +2110,12 @@ gint idx = document_get_cur_idx(); gchar *text;
+ if (doc_list[idx].file_type == NULL) + { + msgwin_status_add(_("Please set the filetype for the current file before using this function.")); + return; + } + switch (doc_list[idx].file_type->id) { case GEANY_FILETYPES_PASCAL: @@ -2152,6 +2170,12 @@ gchar *text; gchar *ext = NULL;
+ if (doc_list[idx].file_type == NULL) + { + msgwin_status_add(_("Please set the filetype for the current file before using this function.")); + return; + } + if (doc_list[idx].file_name == NULL) ext = doc_list[idx].file_type->extension;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.