Changeset 282ec9b for style.c


Ignore:
Timestamp:
Jul 9, 2003, 2:12:36 AM (18 years ago)
Author:
Erik Nygren <nygren@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
a7a42b9
Parents:
5d9c664
Message:
        Make sure that a newline is always at the end of messages
	        returned by perl style formatting functions.
	Add owl::login to legacy variables populated for format_msg.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • style.c

    rf1e629d r282ec9b  
    5454    (* s->formatfunc)(fm, m);
    5555  } else if (s->type==OWL_STYLE_TYPE_PERL) {
    56     char *body, *indent;
     56    char *body, *indent, curlen;
    5757
    5858    /* run the perl function */
    5959    body=owl_perlconfig_getmsg(m, 1, s->perlfuncname);
    6060   
    61     /* indent */
    62     indent=owl_malloc(strlen(body)+owl_text_num_lines(body)*OWL_TAB+10);
     61    /* indent and ensure ends with a newline */
     62    indent=owl_malloc(strlen(body)+(owl_text_num_lines(body))*OWL_TAB+10);
    6363    owl_text_indent(indent, body, OWL_TAB);
    64    
     64    curlen = strlen(indent);
     65    if (curlen==0 || indent[curlen-1] != '\n') {
     66      indent[curlen] = '\n';
     67      indent[curlen+1] = '\0';
     68    }
     69
    6570    /* fmtext_append.  This needs to change */
    6671    owl_fmtext_append_ztext(fm, indent);
Note: See TracChangeset for help on using the changeset viewer.