Index: src/actions.c =================================================================== RCS file: /cvsroot/ratpoison/ratpoison/src/actions.c,v retrieving revision 1.262 diff -u -p -r1.262 actions.c --- src/actions.c 8 Mar 2006 00:33:29 -0000 1.262 +++ src/actions.c 11 Mar 2006 12:59:38 -0000 @@ -425,14 +425,20 @@ pop_frame_list (struct list_head *undo_l static rp_frame_undo * pop_frame_undo () { - return pop_frame_list (&rp_frame_undos, &rp_frame_redos); + rp_frame_undo *r = pop_frame_list (&rp_frame_undos, &rp_frame_redos); + if (r != NULL) + rp_num_frame_undos--; + return r; } /* Pop the head of the frame redo list off and put it in the undo list. */ static rp_frame_undo * pop_frame_redo () { - return pop_frame_list (&rp_frame_redos, &rp_frame_undos); + rp_frame_undo *r = pop_frame_list (&rp_frame_redos, &rp_frame_undos); + if (r != NULL) + rp_num_frame_undos++; + return r; } rp_action* Index: src/main.c =================================================================== RCS file: /cvsroot/ratpoison/ratpoison/src/main.c,v retrieving revision 1.119 diff -u -p -r1.119 main.c --- src/main.c 8 Mar 2006 00:33:29 -0000 1.119 +++ src/main.c 11 Mar 2006 12:59:38 -0000 @@ -744,8 +744,10 @@ clean_up () /* Delete the oldest node */ rp_frame_undo *cur; list_last (cur, &rp_frame_undos, node); + if (cur == NULL) + break; del_frame_undo (cur); } /* Free the global frame numset shared by all screens. */ numset_free (rp_frame_numset);