From 2b5019b42c23686d6f7a53a437126fc8f30c116b Mon Sep 17 00:00:00 2001 From: Rick L Bird Date: Thu, 5 May 2011 17:20:42 -0400 Subject: [PATCH] PennMUSH 1.8.3p11 Author: captdeaf@gmail.com Date: Wed Dec 16 05:26:17 2009 +0000 Oops, forgot to change ' ' to sep in fun_remove. Author: captdeaf@gmail.com Date: Wed Dec 16 05:24:48 2009 +0000 remove() now takes a list of words to delete. Fixes #135 --- src/funlist.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/funlist.c b/src/funlist.c index 9d00179..cbc7340 100644 --- a/src/funlist.c +++ b/src/funlist.c @@ -1731,22 +1731,29 @@ FUNCTION(fun_cat) } } + /* ARGSUSED */ FUNCTION(fun_remove) { char sep; + char lbuff[BUFFER_LEN]; + char *r, *s; /* zap word from string */ if (!delim_check(buff, bp, nargs, args, 3, &sep)) return; - if (strchr(args[1], sep)) { - safe_str(T("#-1 CAN ONLY DELETE ONE ELEMENT"), buff, bp); - return; + r = lbuff; + safe_str(args[0], lbuff, &r); + + s = args[1]; + while ((r = split_token(&s, sep)) != NULL) { + memcpy(lbuff, remove_word(lbuff, r, sep), BUFFER_LEN); } - safe_str(remove_word(args[0], args[1], sep), buff, bp); + safe_str(lbuff, buff, bp); } + /* ARGSUSED */ FUNCTION(fun_items) { -- 2.30.2