gedit r6937 - trunk/plugins/modelines
- From: pborelli svn gnome org
- To: svn-commits-list gnome org
- Subject: gedit r6937 - trunk/plugins/modelines
- Date: Mon, 2 Mar 2009 13:17:55 +0000 (UTC)
Author: pborelli
Date: Mon Mar 2 13:17:55 2009
New Revision: 6937
URL: http://svn.gnome.org/viewvc/gedit?rev=6937&view=rev
Log:
one more change to make valgrind happy
Modified:
trunk/plugins/modelines/modeline-parser.c
Modified: trunk/plugins/modelines/modeline-parser.c
==============================================================================
--- trunk/plugins/modelines/modeline-parser.c (original)
+++ trunk/plugins/modelines/modeline-parser.c Mon Mar 2 13:17:55 2009
@@ -487,10 +487,10 @@
gint line_count,
ModelineOptions *options)
{
- gchar prev = ' ';
+ gchar prev;
/* look for the beginning of a modeline */
- for (; *s != '\0'; prev = *(s++))
+ for (prev = ' '; (s != NULL) && (*s != '\0'); prev = *(s++))
{
if (!g_ascii_isspace (prev))
continue;
@@ -571,11 +571,17 @@
gint cur_line;
guint remaining_lines;
+ /* we are on the 11th line (count from 0) */
cur_line = gtk_text_iter_get_line (&iter);
+ /* g_assert (10 == cur_line); */
remaining_lines = line_count - cur_line - 1;
- gtk_text_buffer_get_end_iter (buffer, &iter);
- gtk_text_iter_backward_lines (&iter, MIN (10, remaining_lines));
+
+ if (remaining_lines > 10)
+ {
+ gtk_text_buffer_get_end_iter (buffer, &iter);
+ gtk_text_iter_backward_lines (&iter, 9);
+ }
}
while (!gtk_text_iter_is_end (&iter))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]