Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fmtext.c

    r7b4f3be rf271129  
    11#include "owl.h"
    2 #include <stdlib.h>
    3 #include <string.h>
    42
    53/* initialize an fmtext with no data */
     
    171169 * freeing the return
    172170 */
    173 char *owl_fmtext_print_plain(const owl_fmtext *f)
     171CALLER_OWN char *owl_fmtext_print_plain(const owl_fmtext *f)
    174172{
    175173  return owl_strip_format_chars(f->buff->str);
     
    186184static void _owl_fmtext_wcolor_set(WINDOW *w, short pair)
    187185{
     186  cchar_t background;
     187  wchar_t blank[2] = { ' ', 0 };
    188188  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);
    191194  }
    192195}
     
    686689         * but zwgc seems to be smarter about some screw cases than I am
    687690         */
     691        g_free(buff);
    688692        owl_fmtext_append_attr(f, "@", curattrs, curcolor, OWL_COLOR_DEFAULT);
    689693        txtptr++;
     
    755759 * If format_fn is specified, passes it the list element value
    756760 * 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;
     761void owl_fmtext_append_list(owl_fmtext *f, const GPtrArray *l, const char *join_with, char *(format_fn)(const char *))
     762{
     763  int i;
    760764  const char *elem;
    761765  char *text;
    762766
    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];
    766769    if (elem && format_fn) {
    767770      text = format_fn(elem);
     
    773776      owl_fmtext_append_normal(f, elem);
    774777    }
    775     if ((i < size-1) && join_with) {
     778    if ((i < l->len - 1) && join_with) {
    776779      owl_fmtext_append_normal(f, join_with);
    777780    }
Note: See TracChangeset for help on using the changeset viewer.