PennMUSH Community

Ticket #6243 (closed suggested feature: fixed)

Opened 5 years ago

Last modified 2 years ago

lattr delimiter

Reported by: anonymous Assigned to: devteam
Priority: minor Milestone: 1.8.3p3
Keywords: Cc:
Visibility: Public

Description (Last modified by raevnos)

Now lattr() accepts an output delimiter as a second argument.

*** ../vanilla-1.7.7p25/src/function.c	2003-10-31 15:07:05.000000000 +0000
--- src/function.c	2003-12-24 12:31:18.000000000 +0000
***************
*** 311,317 ****
    {"ITEMIZE", fun_itemize, 1, 4, FN_REG},
    {"ITEXT", fun_itext, 1, 1, FN_REG},
    {"LAST", fun_last, 1, 2, FN_REG},
!   {"LATTR", fun_lattr, 1, 1, FN_REG},
    {"LCON", fun_lcon, 1, 1, FN_REG},
    {"LCSTR", fun_lcstr, 1, -1, FN_REG},
    {"LDELETE", fun_ldelete, 2, 3, FN_REG},
--- 311,317 ----
    {"ITEMIZE", fun_itemize, 1, 4, FN_REG},
    {"ITEXT", fun_itext, 1, 1, FN_REG},
    {"LAST", fun_last, 1, 2, FN_REG},
!   {"LATTR", fun_lattr, 1, 2, FN_REG},
    {"LCON", fun_lcon, 1, 1, FN_REG},
    {"LCSTR", fun_lcstr, 1, -1, FN_REG},
    {"LDELETE", fun_ldelete, 2, 3, FN_REG},
*** ../vanilla-1.7.7p25/src/fundb.c	2003-10-31 15:07:05.000000000 +0000
--- src/fundb.c	2003-12-24 12:31:54.000000000 +0000
***************
*** 79,84 ****
--- 79,85 ----
    int first;		/**< Is this is the first attribute, or later? */
    char *buff;		/**< Buffer to store output */
    char **bp;		/**< Pointer to address of insertion point in buff */
+   char delim;           /**< Delimiter */
  };
  
  /* this function produces a space-separated list of attributes that are
***************
*** 95,101 ****
    if (lh->first)
      lh->first = 0;
    else
!     safe_chr(' ', lh->buff, lh->bp);
    safe_str(AL_NAME(atr), lh->buff, lh->bp);
    return 1;
  }
--- 96,102 ----
    if (lh->first)
      lh->first = 0;
    else
!     safe_chr(lh->delim, lh->buff, lh->bp);
    safe_str(AL_NAME(atr), lh->buff, lh->bp);
    return 1;
  }
***************
*** 107,112 ****
--- 108,118 ----
    char *pattern;
    struct lh_args lh;
  
+   if (args[1] && *args[1])
+     lh.delim = *args[1];
+   else
+     lh.delim = ' ';
+   
    pattern = strchr(args[0], '/');
    if (pattern)
      *pattern++ = '\0';


Change History

05/01/07 04:38:50 changed by raevnos

  • description changed.
  • milestone set to 1.8.3p3.

05/24/07 09:41:21 changed by raevnos

  • status changed from new to closed.
  • resolution set to fixed.