SF.net SVN: geany: [796] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Wed Sep 6 17:54:11 UTC 2006


Revision: 796
          http://svn.sourceforge.net/geany/?rev=796&view=rev
Author:   eht16
Date:     2006-09-06 10:53:58 -0700 (Wed, 06 Sep 2006)

Log Message:
-----------
Fixed a crash when a compiler output reports an error in a blank line.

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

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-09-06 17:47:00 UTC (rev 795)
+++ trunk/ChangeLog	2006-09-06 17:53:58 UTC (rev 796)
@@ -4,6 +4,9 @@
    Added own implementation of an Undo stack (not yet working).
  * src/utils.c, src/document.c:
    Convert tag names to UTF-8 before showing them in the sidebar.
+ * src/document.c:
+   Fixed a crash when a compiler output reports an error in a blank
+   line(can happen in LaTeX). Thanks to Frank for reporting.
 
 
 2006-09-05  Enrico Tröger  <enrico.troeger at uvena.de>

Modified: trunk/src/document.c
===================================================================
--- trunk/src/document.c	2006-09-06 17:47:00 UTC (rev 795)
+++ trunk/src/document.c	2006-09-06 17:53:58 UTC (rev 796)
@@ -1295,7 +1295,9 @@
 	end = sci_get_position_from_line(doc_list[idx].sci, line + 1);
 
 	// skip blank lines
-	if ((start + 1) == end) return;
+	if ((start + 1) == end ||
+		sci_get_line_length(doc_list[idx].sci, line) == utils_get_eol_char_len(idx))
+		return;
 
 	len = end - start;
 	linebuf = g_malloc(len);
@@ -1312,6 +1314,7 @@
 	current_mask &= INDICS_MASK;
 	current_mask |= INDIC2_MASK;
 	sci_start_styling(doc_list[idx].sci, start + i, INDIC2_MASK);
+	//geany_debug("%p\tline: %d\tstart-end: %d - %d\t%d - %i", doc_list[idx].sci, line, start, end, len, i);
 	sci_set_styling(doc_list[idx].sci, len - i, current_mask);
 }
 


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