Mercurial > hg > xemacs-beta
comparison src/window.c @ 5171:8cd17b2131a1
fix further crash in window-mirror finding
-------------------- ChangeLog entries follow: --------------------
src/ChangeLog addition:
2010-03-28 Ben Wing <ben@xemacs.org>
* window.c (find_window_mirror_internal):
Stop looking if no window mirror, and return 0.
* window.c (window_display_lines):
* window.c (window_display_buffer):
* window.c (set_window_display_buffer):
Don't need to update window mirror before calling find_window_mirror
because does the updating automatically.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Mon, 29 Mar 2010 00:00:06 -0500 |
parents | 5ddbab03b0e6 |
children | be6e5ea38dda |
comparison
equal
deleted
inserted
replaced
5170:5ddbab03b0e6 | 5171:8cd17b2131a1 |
---|---|
625 redisplay structures. */ | 625 redisplay structures. */ |
626 static struct window_mirror * | 626 static struct window_mirror * |
627 find_window_mirror_internal (Lisp_Object win, struct window_mirror *rmir, | 627 find_window_mirror_internal (Lisp_Object win, struct window_mirror *rmir, |
628 struct window *w) | 628 struct window *w) |
629 { | 629 { |
630 for (; !NILP (win); win = XWINDOW (win)->next, rmir = rmir->next) | 630 for (; !NILP (win) && rmir; win = XWINDOW (win)->next, rmir = rmir->next) |
631 { | 631 { |
632 if (w == XWINDOW (win)) | 632 if (w == XWINDOW (win)) |
633 return rmir; | 633 return rmir; |
634 | 634 |
635 if (!NILP (XWINDOW (win)->vchild)) | 635 if (!NILP (XWINDOW (win)->vchild)) |
762 display_line_dynarr * | 762 display_line_dynarr * |
763 window_display_lines (struct window *w, int which) | 763 window_display_lines (struct window *w, int which) |
764 { | 764 { |
765 struct window_mirror *t; | 765 struct window_mirror *t; |
766 | 766 |
767 if (XFRAME (w->frame)->mirror_dirty) | |
768 update_frame_window_mirror (XFRAME (w->frame)); | |
769 t = find_window_mirror (w); | 767 t = find_window_mirror (w); |
770 assert (t); | 768 assert (t); |
771 | 769 |
772 if (which == CURRENT_DISP) | 770 if (which == CURRENT_DISP) |
773 return t->current_display_lines; | 771 return t->current_display_lines; |
785 struct buffer * | 783 struct buffer * |
786 window_display_buffer (struct window *w) | 784 window_display_buffer (struct window *w) |
787 { | 785 { |
788 struct window_mirror *t; | 786 struct window_mirror *t; |
789 | 787 |
790 if (XFRAME (w->frame)->mirror_dirty) | |
791 update_frame_window_mirror (XFRAME (w->frame)); | |
792 t = find_window_mirror (w); | 788 t = find_window_mirror (w); |
793 assert (t); | 789 assert (t); |
794 | 790 |
795 return t->buffer; | 791 return t->buffer; |
796 } | 792 } |
798 void | 794 void |
799 set_window_display_buffer (struct window *w, struct buffer *b) | 795 set_window_display_buffer (struct window *w, struct buffer *b) |
800 { | 796 { |
801 struct window_mirror *t; | 797 struct window_mirror *t; |
802 | 798 |
803 if (XFRAME (w->frame)->mirror_dirty) | |
804 update_frame_window_mirror (XFRAME (w->frame)); | |
805 t = find_window_mirror (w); | 799 t = find_window_mirror (w); |
806 assert (t); | 800 assert (t); |
807 | 801 |
808 t->buffer = b; | 802 t->buffer = b; |
809 } | 803 } |