X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=libchimara%2Fwindow.c;h=5a194f4572bfc3fc62a0a7aaaa4854737f6d0209;hb=5cbd4d79bb8699746b85353d6ab25ee5c48174ff;hp=41bd9f0f6856928664acebda755380a669a20495;hpb=007d80fedce14ccf35ec671a449b8d3c824b1ed6;p=projects%2Fchimara%2Fchimara.git diff --git a/libchimara/window.c b/libchimara/window.c index 41bd9f0..5a194f4 100644 --- a/libchimara/window.c +++ b/libchimara/window.c @@ -35,6 +35,8 @@ window_new_common(glui32 rock) win->history = NULL; win->echo_line_input = TRUE; win->echo_current_line_input = TRUE; + win->extra_line_terminators = NULL; + win->current_extra_line_terminators = NULL; /* Initialise the buffer */ win->buffer = g_string_sized_new(1024); @@ -65,6 +67,8 @@ window_close_common(winid_t win, gboolean destroy_node) g_list_foreach(win->history, (GFunc)g_free, NULL); g_list_free(win->history); + g_slist_free(win->extra_line_terminators); + g_slist_free(win->current_extra_line_terminators); g_string_free(win->buffer, TRUE); g_hash_table_destroy(win->hyperlinks); @@ -198,8 +202,8 @@ glk_window_get_sibling(winid_t win) if(G_NODE_IS_ROOT(win->window_node)) return NULL; if(win->window_node->next) - return (winid_t)win->window_node->next; - return (winid_t)win->window_node->prev; + return (winid_t)win->window_node->next->data; + return (winid_t)win->window_node->prev->data; } /** @@ -458,8 +462,9 @@ glk_window_open(winid_t split, glui32 method, glui32 size, glui32 wintype, glui32 rock) { VALID_WINDOW_OR_NULL(split, return NULL); - g_return_val_if_fail(method == (method & (winmethod_DirMask | winmethod_DivisionMask)), NULL); - g_return_val_if_fail(!(((method & winmethod_DivisionMask) == winmethod_Proportional) && size > 100), NULL); + g_return_val_if_fail(!(((method & winmethod_DivisionMask) == winmethod_Proportional) && size > 100), NULL); + if(method != (method & (winmethod_DirMask | winmethod_DivisionMask | winmethod_BorderMask))) + WARNING("Unrecognized bits in method constant"); ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);