Changeset f60b417


Ignore:
Timestamp:
Jul 20, 2011, 4:42:29 PM (10 years ago)
Author:
GitHub Merge Button <merge-button@github.com>
Parents:
d8f22b6 (diff), ac919d96 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:
Merge ac919d96a68d7391f70c2a23255449d5f0b686fd into d8f22b65abfc43c50c273302ba9cffe7dc383ed0
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cmd.c

    rce68f23 r4d4f0ba  
    260260  if (cmd->usage && *cmd->usage) {
    261261    s = cmd->usage;
    262     indent = owl_text_indent(s, OWL_TAB);
     262    indent = owl_text_indent(s, OWL_TAB, true);
    263263    owl_fmtext_append_bold(fm, "\nSYNOPSIS\n");
    264264    owl_fmtext_append_normal(fm, indent);
     
    274274  if (cmd->description && *cmd->description) {
    275275    s = cmd->description;
    276     indent = owl_text_indent(s, OWL_TAB);
     276    indent = owl_text_indent(s, OWL_TAB, true);
    277277    owl_fmtext_append_bold(fm, "\nDESCRIPTION\n");
    278278    owl_fmtext_append_normal(fm, indent);
  • functions.c

    r837bd81 rac919d96  
    14301430#ifdef HAVE_LIBZEPHYR
    14311431    if (owl_message_is_direction_in(m)) {
    1432       char *tmpbuff;
     1432      char *tmpbuff, *tmpbuff2;
    14331433      int i, fields;
    14341434
     
    14761476
    14771477        for (i = 0; i < fields; i++) {
    1478           tmpbuff = owl_zephyr_get_field_as_utf8(n, i + 1);
    1479 
    1480           g_strdelimit(tmpbuff, "\n", '~');
    1481           g_strdelimit(tmpbuff, "\r", '!');
    1482 
    1483           owl_fmtext_appendf_normal(&fm, "  Field %i   : %s\n", i + 1, tmpbuff);
    1484           g_free(tmpbuff);
     1478          tmpbuff = owl_zephyr_get_field_as_utf8(n, i + 1);
     1479          tmpbuff2 = owl_text_indent(tmpbuff, 14, false);
     1480          owl_fmtext_appendf_normal(&fm, "  Field %i   : %s\n", i + 1, tmpbuff2);
     1481          g_free(tmpbuff2);
     1482          g_free(tmpbuff);
    14851483        }
    1486         owl_fmtext_appendf_normal(&fm, "  Default Fm: %s\n", n->z_default_format);
     1484        tmpbuff = owl_text_indent(n->z_default_format, 14, false);
     1485        owl_fmtext_appendf_normal(&fm, "  Default Fm: %s\n", tmpbuff);
     1486        g_free(tmpbuff);
    14871487      }
    14881488
  • message.c

    rdde1b4d rac919d96  
    125125    p = m->attributes->pdata[i];
    126126
    127     tmpbuff = g_strdup(owl_pair_get_value(p));
    128     g_strdelimit(tmpbuff, "\n", '~');
    129     g_strdelimit(tmpbuff, "\r", '!');
    130     buff = g_strdup_printf("  %-15.15s: %s\n", owl_pair_get_key(p), tmpbuff);
    131     g_free(tmpbuff);
     127    buff = g_strdup(owl_pair_get_value(p));
     128    if (buff) {
     129      tmpbuff = owl_text_indent(buff, 19, false);
     130      g_free(buff);
     131      buff = g_strdup_printf("  %-15.15s: %s\n", owl_pair_get_key(p), tmpbuff);
     132      g_free(tmpbuff);
     133    }
    132134
    133135    if(buff == NULL) {
  • style.c

    rfa180a3 r4d4f0ba  
    6565
    6666  /* indent and ensure ends with a newline */
    67   indent = owl_text_indent(body, OWL_TAB);
     67  indent = owl_text_indent(body, OWL_TAB, true);
    6868  curlen = strlen(indent);
    6969  if (curlen == 0 || indent[curlen-1] != '\n') {
  • text.c

    r6829afc r4d4f0ba  
    77/* Returns a copy of 'in' with each line indented 'n'
    88 * characters. Result must be freed with g_free. */
    9 CALLER_OWN char *owl_text_indent(const char *in, int n)
     9CALLER_OWN char *owl_text_indent(const char *in, int n, bool indent_first_line)
    1010{
    1111  const char *ptr1, *ptr2, *last;
    1212  GString *out = g_string_new("");
    1313  int i;
     14  bool indent_this_line = indent_first_line;
    1415
    1516  last=in+strlen(in)-1;
    1617  ptr1=in;
    1718  while (ptr1<=last) {
    18     for (i=0; i<n; i++) {
    19       g_string_append_c(out, ' ');
    20     }
     19    if (indent_this_line) {
     20      for (i = 0; i < n; i++) {
     21        g_string_append_c(out, ' ');
     22      }
     23    }
     24    indent_this_line = true;
    2125    ptr2=strchr(ptr1, '\n');
    2226    if (!ptr2) {
Note: See TracChangeset for help on using the changeset viewer.