Changeset 259e60a8


Ignore:
Timestamp:
May 30, 2011, 7:46:21 PM (13 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.10, release-1.8, release-1.9
Children:
44976fe, 9835b7a
Parents:
8ffa264
git-author:
Jason Gross <jgross@mit.edu> (05/18/11 16:25:58)
git-committer:
Anders Kaseorg <andersk@mit.edu> (05/30/11 19:46:21)
Message:
Remove the length limit on field values in :info
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r8ffa264 r259e60a8  
    14081408#ifdef HAVE_LIBZEPHYR
    14091409    if (owl_message_is_direction_in(m)) {
    1410       char *ptr, tmpbuff[1024];
    1411       int i, j, fields, len;
     1410      char *tmpbuff;
     1411      int i, fields;
    14121412
    14131413      n=owl_message_get_notice(m);
     
    14531453        owl_fmtext_appendf_normal(&fm, "  Fields    : %i\n", fields);
    14541454
    1455         for (i=0; i<fields; i++) {
    1456           ptr=owl_zephyr_get_field_as_utf8(n, i+1);
    1457           len=strlen(ptr);
    1458           if (len<30) {
    1459             strncpy(tmpbuff, ptr, len);
    1460             tmpbuff[len]='\0';
    1461           } else {
    1462             strncpy(tmpbuff, ptr, 30);
    1463             tmpbuff[30]='\0';
    1464             strcat(tmpbuff, "...");
    1465           }
    1466           g_free(ptr);
    1467 
    1468           for (j=0; j<strlen(tmpbuff); j++) {
    1469             if (tmpbuff[j]=='\n') tmpbuff[j]='~';
    1470             if (tmpbuff[j]=='\r') tmpbuff[j]='!';
    1471           }
    1472 
    1473           owl_fmtext_appendf_normal(&fm, "  Field %i   : %s\n", i+1, tmpbuff);
     1455        for (i = 0; i < fields; i++) {
     1456          tmpbuff = owl_zephyr_get_field_as_utf8(n, i + 1);
     1457
     1458          g_strdelimit(tmpbuff, "\n", '~');
     1459          g_strdelimit(tmpbuff, "\r", '!');
     1460
     1461          owl_fmtext_appendf_normal(&fm, "  Field %i   : %s\n", i + 1, tmpbuff);
     1462          g_free(tmpbuff);
    14741463        }
    14751464        owl_fmtext_appendf_normal(&fm, "  Default Fm: %s\n", n->z_default_format);
  • message.c

    r3a3863e r259e60a8  
    120120  int i, j;
    121121  owl_pair *p;
    122   char *buff;
     122  char *buff, *tmpbuff;
    123123
    124124  owl_fmtext_init_null(fm);
     
    127127  for (i=0; i<j; i++) {
    128128    p=owl_list_get_element(&(m->attributes), i);
    129     buff=g_strdup_printf("  %-15.15s: %-35.35s\n", owl_pair_get_key(p), owl_pair_get_value(p));
     129
     130    tmpbuff = g_strdup(owl_pair_get_value(p));
     131    g_strdelimit(tmpbuff, "\n", '~');
     132    g_strdelimit(tmpbuff, "\r", '!');
     133    buff = g_strdup_printf("  %-15.15s: %s\n", owl_pair_get_key(p), tmpbuff);
     134    g_free(tmpbuff);
     135
    130136    if(buff == NULL) {
    131       buff=g_strdup_printf("  %-15.15s: %-35.35s\n", owl_pair_get_key(p), "<error>");
     137      buff = g_strdup_printf("  %-15.15s: %s\n", owl_pair_get_key(p), "<error>");
    132138      if(buff == NULL)
    133139        buff=g_strdup("   <error>\n");
Note: See TracChangeset for help on using the changeset viewer.