Changes in fmtext.c [7b4f3be:f271129]
Legend:
- Unmodified
- Added
- Removed
-
fmtext.c
r7b4f3be rf271129 1 1 #include "owl.h" 2 #include <stdlib.h>3 #include <string.h>4 2 5 3 /* initialize an fmtext with no data */ … … 171 169 * freeing the return 172 170 */ 173 char *owl_fmtext_print_plain(const owl_fmtext *f)171 CALLER_OWN char *owl_fmtext_print_plain(const owl_fmtext *f) 174 172 { 175 173 return owl_strip_format_chars(f->buff->str); … … 186 184 static void _owl_fmtext_wcolor_set(WINDOW *w, short pair) 187 185 { 186 cchar_t background; 187 wchar_t blank[2] = { ' ', 0 }; 188 188 if (has_colors()) { 189 wcolor_set(w,pair,NULL); 190 wbkgdset(w, COLOR_PAIR(pair)); 189 wcolor_set(w, pair, NULL); 190 /* Set the background with wbkgrndset so that we can handle color-pairs 191 * past 256 on ncurses ABI 6 and later. */ 192 setcchar(&background, blank, 0, pair, NULL); 193 wbkgrndset(w, &background); 191 194 } 192 195 } … … 686 689 * but zwgc seems to be smarter about some screw cases than I am 687 690 */ 691 g_free(buff); 688 692 owl_fmtext_append_attr(f, "@", curattrs, curcolor, OWL_COLOR_DEFAULT); 689 693 txtptr++; … … 755 759 * If format_fn is specified, passes it the list element value 756 760 * and it will return a string which this needs to free. */ 757 void owl_fmtext_append_list(owl_fmtext *f, const owl_list*l, const char *join_with, char *(format_fn)(const char *))758 { 759 int i , size;761 void owl_fmtext_append_list(owl_fmtext *f, const GPtrArray *l, const char *join_with, char *(format_fn)(const char *)) 762 { 763 int i; 760 764 const char *elem; 761 765 char *text; 762 766 763 size = owl_list_get_size(l); 764 for (i=0; i<size; i++) { 765 elem = owl_list_get_element(l,i); 767 for (i = 0; i < l->len; i++) { 768 elem = l->pdata[i]; 766 769 if (elem && format_fn) { 767 770 text = format_fn(elem); … … 773 776 owl_fmtext_append_normal(f, elem); 774 777 } 775 if ((i < size-1) && join_with) {778 if ((i < l->len - 1) && join_with) { 776 779 owl_fmtext_append_normal(f, join_with); 777 780 }
Note: See TracChangeset
for help on using the changeset viewer.