Index: gtk/gtktextiter.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktextiter.c,v
retrieving revision 1.85.2.5
diff -u -p -r1.85.2.5 gtktextiter.c
--- gtk/gtktextiter.c	22 Feb 2006 19:46:15 -0000	1.85.2.5
+++ gtk/gtktextiter.c	3 Apr 2006 10:51:20 -0000
@@ -1567,10 +1567,23 @@ gtk_text_iter_ends_line (const GtkTextIt
     return TRUE;
   else if (wc == '\n')
     {
+      GtkTextIter tmp = *iter;
+
       /* need to determine if a \r precedes the \n, in which case
-       * we aren't the end of the line
+       * we aren't the end of the line.
+       * Note however that \r\n should be on the same line:
+       * if we have a file with mixed line terminators like
+
+          1 some text\r
+          2 \n
+          3 ...
+
+       * both \r and \n are terminators of their line.
        */
-      GtkTextIter tmp = *iter;
+
+      if (gtk_text_iter_get_line_offset (&tmp) == 0)
+        return TRUE;
+
       if (!gtk_text_iter_backward_char (&tmp))
         return TRUE;
 
