Changeset 7e3e00a for message.c


Ignore:
Timestamp:
Feb 11, 2003, 11:14:36 AM (18 years ago)
Author:
James M. Kretchmar <kretch@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:
a2641cd9
Parents:
8f44c6b
Message:
Added thew 'newlinestrip' variable, on by default, that strips leading
and trailing newlines from incoming zephyrs.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • message.c

    r5a35ae8e r7e3e00a  
    361361  struct hostent *hent;
    362362  int k, ret;
    363   char *ptr;
     363  char *ptr, *tmp;
    364364
    365365  m->id=owl_global_get_nextmsgid(&g);
     
    397397  /* set the body */
    398398  ptr=owl_zephyr_get_message(n, &k);
    399   m->body=owl_malloc(k+10);
    400   memcpy(m->body, ptr, k);
    401   m->body[k]='\0';
     399  tmp=owl_malloc(k+10);
     400  memcpy(tmp, ptr, k);
     401  tmp[k]='\0';
     402  if (owl_global_is_newlinestrip(&g)) {
     403    m->body=owl_util_stripnewlines(tmp);
     404    owl_free(tmp);
     405  } else {
     406    m->body=tmp;
     407  }
    402408
    403409  /* if zcrypt is enabled try to decrypt the message */
Note: See TracChangeset for help on using the changeset viewer.