This is patch15 to PennMUSH 1.7.4. After applying this patch, you will have version 1.7.4p15 To apply this patch, save it to a file in your top-level MUSH directory, and do the following: patch -p1 < 1.7.4-patch15 make install If you use GNU patch 2.2, you probably want the above to be 'patch -b -p1', not just 'patch -p1'. Unix (or cygwin) users need not worry about failed hunks in src/switchinc.c, hdrs/switches.h, hdrs/cmds.h, or hdrs/funs.h. These files are automatically rebuilt on compile. Then @shutdown and restart your MUSH. - Alan/Javelin In this patch: Minor Changes: * @dolist and iter(), where multiple tokens are replaced (## and #@), now do both replacements at once. This is more efficient in several ways and fixes a problem where if the second token gets into the string from a replacement of the first, it gets replaced. (iter(a#@, ##) should return a#@, not a1). [SW] * setunion no longer eats empty list elements. [SW] * The help text for items() is now more descriptive of how it works and differs from words(). Suggested by Zen@SW1. * When you attempt to @chzone an object to a ZMO without a zone-lock, a default zone-lock of "owner of the ZMO" is now set, and the attempt succeeds. Suggested by Linda Antonsson. * In the French message translation files, the word 'drapeau' and 'flag' were used interchangeably. I've standardized on 'flag'. Report by Vexon@M*U*S*H. Fixes: * Message typo fixed by Bellemore@M*U*S*H. * No more ansified names in logged shutdown messages. Report by Bellemore@M*U*S*H. * Messages when destroying players now take into account the destroy_possessions and really_safe settings. Suggested by Wayne@PDX. * The parser no longer strips any first layer of braces in, e.g. @switch action clauses, but only when the first character in the clause is a brace. This prevents @sw 1=1, @wait me={@emit 1; @emit 2} from being misparsed and running @emit 2 immediately. Reported by Azratax@Azmush. [TAP] Prereq: 1.7.4p14 *** 1_7_4.200/Patchlevel Fri, 04 Jan 2002 14:28:24 -0600 dunemush (pennmush/5_Patchlevel 1.32 600) --- 1_7_4.209(w)/Patchlevel Fri, 08 Feb 2002 10:43:53 -0600 dunemush (pennmush/5_Patchlevel 1.33 600) *************** *** 1,2 **** Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.7.4p14 --- 1,2 ---- Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.7.4p15 *** 1_7_4.200/CHANGES Wed, 23 Jan 2002 10:11:06 -0600 dunemush (pennmush/8_CHANGES 1.219.1.66 600) --- 1_7_4.209(w)/CHANGES Fri, 08 Feb 2002 10:43:37 -0600 dunemush (pennmush/8_CHANGES 1.219.1.72.1.1 600) *************** *** 9,21 **** [SW] is Shawn Wagner, a PennMUSH developer (aka Raevnos) [LdW] is Luuk de Waard, a former PennMUSH developer (aka Halatir) [RLM] is Ralph Melton, a former PennMUSH developer ! [NJG] is Nick Gammon, the Win32 porter [DW] is Dan Williams, the MacOS porter [2.2] refers to code which originated with the TinyMUSH 2.2 developers [3] refers to code by (or inspired by) TinyMUSH 3.0 [Rhost] refers to code by (or inspired by) RhostMUSH ========================================================================== Version 1.7.4 patchlevel 14 January 4, 2002 --- 9,51 ---- [SW] is Shawn Wagner, a PennMUSH developer (aka Raevnos) [LdW] is Luuk de Waard, a former PennMUSH developer (aka Halatir) [RLM] is Ralph Melton, a former PennMUSH developer ! [NJG] is Nick Gammon, the primary Win32 porter ! [EEH] is Ervin Hearn III, a Win32 porter (aka Noltar) [DW] is Dan Williams, the MacOS porter [2.2] refers to code which originated with the TinyMUSH 2.2 developers [3] refers to code by (or inspired by) TinyMUSH 3.0 [Rhost] refers to code by (or inspired by) RhostMUSH ========================================================================== + + Version 1.7.4 patchlevel 15 February 8, 2002 + + Minor Changes: + * @dolist and iter(), where multiple tokens are replaced (## and #@), + now do both replacements at once. This is more efficient in several + ways and fixes a problem where if the second token gets into the + string from a replacement of the first, it gets replaced. (iter(a#@, + ##) should return a#@, not a1). [SW] + * setunion no longer eats empty list elements. [SW] + * The help text for items() is now more descriptive of how it works + and differs from words(). Suggested by Zen@SW1. + * When you attempt to @chzone an object to a ZMO without a zone-lock, + a default zone-lock of "owner of the ZMO" is now set, and the + attempt succeeds. Suggested by Linda Antonsson. + * In the French message translation files, the word 'drapeau' and + 'flag' were used interchangeably. I've standardized on 'flag'. + Report by Vexon@M*U*S*H. + Fixes: + * Message typo fixed by Bellemore@M*U*S*H. + * No more ansified names in logged shutdown messages. Report by + Bellemore@M*U*S*H. + * Messages when destroying players now take into account the + destroy_possessions and really_safe settings. Suggested by Wayne@PDX. + * The parser no longer strips any first layer of braces in, e.g. + @switch action clauses, but only when the first character in the + clause is a brace. This prevents @sw 1=1, @wait me={@emit 1; @emit 2} + from being misparsed and running @emit 2 immediately. Reported by + Azratax@Azmush. [TAP] Version 1.7.4 patchlevel 14 January 4, 2002 *** 1_7_4.200/game/txt/hlp/pennvers.hlp Wed, 23 Jan 2002 10:11:06 -0600 dunemush (pennmush/12_pennvers.h 1.169.1.42.1.3.1.1 600) --- 1_7_4.209(w)/game/txt/hlp/pennvers.hlp Fri, 15 Feb 2002 08:20:47 -0600 dunemush (pennmush/12_pennvers.h 1.169.1.42.1.3.1.2.2.1 600) *************** *** 1,5 **** & changes ! & 1.7.4p14 This is a list of changes in this patchlevel which are probably of interest to players. More information about new commands and functions can probably be gotten via 'help '. 'help credits' --- 1,5 ---- & changes ! & 1.7.4p15 This is a list of changes in this patchlevel which are probably of interest to players. More information about new commands and functions can probably be gotten via 'help '. 'help credits' *************** *** 11,16 **** --- 11,46 ---- A list of the patchlevels associated with each release can be read in 'help patchlevels'. + Version 1.7.4 patchlevel 15 February 8, 2002 + + Minor Changes: + * @dolist and iter(), where multiple tokens are replaced (## and #@), + now do both replacements at once. This is more efficient in several + ways and fixes a problem where if the second token gets into the + string from a replacement of the first, it gets replaced. (iter(a#@, + ##) should return a#@, not a1). [SW] + * setunion no longer eats empty list elements. [SW] + * The help text for items() is now more descriptive of how it works + and differs from words(). Suggested by Zen@SW1. + * When you attempt to @chzone an object to a ZMO without a zone-lock, + a default zone-lock of "owner of the ZMO" is now set, and the + attempt succeeds. Suggested by Linda Antonsson. + * In the French message translation files, the word 'drapeau' and + 'flag' were used interchangeably. I've standardized on 'flag'. + Report by Vexon@M*U*S*H. + Fixes: + * Message typo fixed by Bellemore@M*U*S*H. + * No more ansified names in logged shutdown messages. Report by + Bellemore@M*U*S*H. + * Messages when destroying players now take into account the + destroy_possessions and really_safe settings. Suggested by Wayne@PDX. + * The parser no longer strips any first layer of braces in, e.g. + @switch action clauses, but only when the first character in the + clause is a brace. This prevents @sw 1=1, @wait me={@emit 1; @emit 2} + from being misparsed and running @emit 2 immediately. Reported by + Azratax@Azmush. [TAP] + + & 1.7.4p14 Version 1.7.4 patchlevel 14 January 4, 2002 Minor Changes: *************** *** 4948,4954 **** For information on a specific patchlevel of one of the versions listed, type 'help p'. For example, 'help 1.7.2p3' ! 1.7.4: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 1.7.3: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 1.7.2: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35 --- 4978,4984 ---- For information on a specific patchlevel of one of the versions listed, type 'help p'. For example, 'help 1.7.2p3' ! 1.7.4: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 1.7.3: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 1.7.2: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35 *** 1_7_4.200/game/txt/hlp/pennfunc.hlp Fri, 04 Jan 2002 14:27:30 -0600 dunemush (pennmush/16_pennfunc.h 1.2.1.50.1.1.1.1.1.2.1.7.1.8.1.1.1.1.1.1.1.1 600) --- 1_7_4.209(w)/game/txt/hlp/pennfunc.hlp Thu, 24 Jan 2002 16:23:02 -0600 dunemush (pennmush/16_pennfunc.h 1.2.1.50.1.1.1.1.1.2.1.7.1.8.1.1.1.1.1.1.1.1.1.1 600) *************** *** 1350,1363 **** & ITEMS() items(,) ! ! This counts the number of items in a list which uses some arbitrary ! separator. This is similar in function to WORDS(), but it does not ! have a default separator. ! ! Example: ! > say [items(this|is|a|short|string,|)] ! You say, "5" & ITEMIZE() & ELIST() itemize([,[,[,]]]) --- 1350,1368 ---- & ITEMS() items(,) ! ! items() counts the number of items in a list using an arbitrary ! (required) separator. Null items are counted, so: ! ! items(X|X,|) => 2 (2 X items) ! items(X||X,|) => 3 (2 X items and 1 null item) ! items(X X,%b) => 2 (2 X items) ! items(X%b%bX,%b) => 3 (2 X items and 1 null item) ! items(,|) => 1 (a single null item) ! ! Another way to think about this is that items() counts the number ! of delimiters in the string, and adds 1. ! & ITEMIZE() & ELIST() itemize([,[,[,]]]) *** 1_7_4.200/src/strutil.c Mon, 13 Aug 2001 19:51:56 -0500 dunemush (pennmush/b/33_strutil.c 1.28.1.3.1.3.1.7 660) --- 1_7_4.209(w)/src/strutil.c Fri, 15 Feb 2002 08:43:09 -0600 dunemush (pennmush/b/33_strutil.c 1.28.1.3.1.3.1.7.2.1.1.1 660) *************** *** 411,478 **** } int ! u_strlen(s) ! const unsigned char *s; { return strlen((char *) s); } unsigned char * ! u_strcpy(target, source) ! unsigned char *target; ! const unsigned char *source; { return (unsigned char *) strcpy((char *) target, (char *) source); } char * ! replace_string(old, newbit, string) ! const char *old; ! const char *newbit; ! const char *string; { ! /* another 2.0 function: replaces string "old" with string "newbit". ! * The result returned by this must be freed. ! */ ! char *result, *r, *s; ! int len; ! if (!string) ! return NULL; ! s = (char *) string; ! len = strlen(old); ! r = result = (char *) malloc(BUFFER_LEN + 1); ! #ifdef MEM_CHECK ! add_check("replace_string.buff"); ! #endif ! while (*s) { ! /* copy up to the next occurence of first char of old */ ! while (*s && *s != *old) { ! safe_chr(*s, result, &r); ! s++; ! } ! ! /* if we've really found old, append newbit to the result and ! * move past the occurence of old. Else, copy the char and ! * continue. ! */ ! if (*s) { ! if (!strncmp(old, s, len)) { ! safe_str((char *) newbit, result, &r); ! s += len; ! } else { ! safe_chr(*s, result, &r); ! s++; ! } } } ! *r = '\0'; return result; } #ifdef CAN_NEWSTYLE --- 411,511 ---- } int ! u_strlen(const unsigned char *s) { return strlen((char *) s); } unsigned char * ! u_strcpy(unsigned char *target, const unsigned char *source) { return (unsigned char *) strcpy((char *) target, (char *) source); } char * ! replace_string(const char *old, const char *newbit, const char *string) { ! char tbuf1[BUFFER_LEN], *tbuf = tbuf1; ! char *result, *r; ! Size_t len; ! ! r = result = mush_malloc(BUFFER_LEN, "replace_string.buff"); ! if (!result) ! panic(T("Couldn't allocate memory in replace_string!")); ! len = strlen(old); ! strcpy(tbuf, string); ! while (*tbuf) { ! char *s = strstr(tbuf, old); ! if (s) { /* Match found! */ ! *s = '\0'; ! safe_str(tbuf, result, &r); ! safe_str(newbit, result, &r); ! tbuf = s + len; ! } else { ! safe_str(tbuf, result, &r); ! break; ! } ! } ! *r = '\0'; ! return result; ! } ! const char *standard_tokens[2] = { "##", "#@" }; ! /* Replace two tokens in a string at once. All-around better than calling ! * replace_string() twice ! */ ! char * ! replace_string2(const char *old[2], const char *newbits[2], const char *string) ! { ! char tbuf1[BUFFER_LEN], *tbuf = tbuf1; ! char *result, *rp; ! char firsts[3] = { '\0', '\0', '\0' }; ! Size_t oldlens[2]; ! ! ! if (!string) ! return NULL; ! ! rp = result = mush_malloc(BUFFER_LEN, "replace_string.buff"); ! if (!result) ! panic(T("Couldn't allocate memory in replace_string2!")); ! ! firsts[0] = old[0][0]; ! firsts[1] = old[1][0]; ! ! oldlens[0] = strlen(old[0]); ! oldlens[1] = strlen(old[1]); ! ! strcpy(tbuf, string); ! ! while (*tbuf) { ! Size_t skip = strcspn(tbuf, firsts); ! if (skip) { ! char c = tbuf[skip]; ! tbuf[skip] = '\0'; ! safe_str(tbuf, result, &rp); ! tbuf[skip] = c; ! tbuf += skip; ! } ! if (strncmp(tbuf, old[0], oldlens[0]) == 0) { /* Copy the first */ ! safe_str(newbits[0], result, &rp); ! tbuf += oldlens[0]; ! } else if (strncmp(tbuf, old[1], oldlens[1]) == 0) { /* The second */ ! safe_str(newbits[1], result, &rp); ! tbuf += oldlens[1]; ! } else { ! safe_chr(*tbuf, result, &rp); ! tbuf++; } } ! *rp = '\0'; return result; + } #ifdef CAN_NEWSTYLE *************** *** 603,616 **** /* Strlen that ignores ansi and HTML sequences */ int ! ansi_strlen(string) ! char *string; { int i = 0; char *p; if (!ANSI_JUSTIFY) return strlen(string); ! p = string; if (!p) return 0; while (*p) { --- 636,648 ---- /* Strlen that ignores ansi and HTML sequences */ int ! ansi_strlen(const char *string) { int i = 0; char *p; if (!ANSI_JUSTIFY) return strlen(string); ! p = (char *) string; if (!p) return 0; while (*p) { *************** *** 631,643 **** /* Returns true length of string up to numchars visible characters. */ int ! ansi_strnlen(string, numchars) ! char *string; ! unsigned int numchars; { int i = 0; char *p; ! p = string; if (!p) return 0; while (*p && numchars > 0) { --- 663,673 ---- /* Returns true length of string up to numchars visible characters. */ int ! ansi_strnlen(const char *string, Size_t numchars) { int i = 0; char *p; ! p = (char *) string; if (!p) return 0; while (*p && numchars > 0) { *************** *** 732,740 **** /* Strip all ansi and html markup from a string */ char * ! remove_markup(orig, s_len) ! const char *orig; ! Size_t *s_len; { static char buff[BUFFER_LEN]; char *bp = buff; --- 762,768 ---- /* Strip all ansi and html markup from a string */ char * ! remove_markup(const char *orig, Size_t * s_len) { static char buff[BUFFER_LEN]; char *bp = buff; *************** *** 999,1006 **** void ! populate_codes(as) ! ansi_string *as; { int p; char *current = NULL; --- 1027,1033 ---- void ! populate_codes(ansi_string * as) { int p; char *current = NULL; *************** *** 1021,1028 **** } void ! depopulate_codes(as) ! ansi_string *as; { int p; --- 1048,1054 ---- } void ! depopulate_codes(ansi_string * as) { int p; *************** *** 1045,1078 **** } } ! static int is_ansi_code _((const char *s)); ! static int is_start_html_code _((const char *s)) __attribute__ ((__unused__)); ! static int is_end_html_code _((const char *s)); static int ! is_ansi_code(s) ! const char *s; { return s && *s == ESC_CHAR; } static int ! is_start_html_code(s) ! const char *s; { return s && *s == TAG_START && *(s + 1) != '/'; } static int ! is_end_html_code(s) ! const char *s; { return s && *s == TAG_START && *(s + 1) == '/'; } void ! free_ansi_string(as) ! ansi_string *as; { int p; --- 1071,1100 ---- } } ! static int is_ansi_code(const char *s); ! static int is_start_html_code(const char *s) __attribute__ ((__unused__)); ! static int is_end_html_code(const char *s); static int ! is_ansi_code(const char *s) { return s && *s == ESC_CHAR; } static int ! is_start_html_code(const char *s) { return s && *s == TAG_START && *(s + 1) != '/'; } static int ! is_end_html_code(const char *s) { return s && *s == TAG_START && *(s + 1) == '/'; } void ! free_ansi_string(ansi_string * as) { int p; *************** *** 1086,1096 **** } int ! safe_ansi_string(as, start, len, buff, bp) ! ansi_string *as; ! int start, len; ! char *buff; ! char **bp; { int p; int in_ansi = 0; --- 1108,1114 ---- } int ! safe_ansi_string(ansi_string * as, int start, int len, char *buff, char **bp) { int p; int in_ansi = 0; *** 1_7_4.200/src/set.c Mon, 02 Jul 2001 10:18:36 -0500 dunemush (pennmush/b/38_set.c 1.26.1.5 660) --- 1_7_4.209(w)/src/set.c Fri, 15 Feb 2002 08:43:09 -0600 dunemush (pennmush/b/38_set.c 1.26.1.5.1.1.2.1 660) *************** *** 384,400 **** return; } /* Don't allow chzone to objects without elocks! * This checks for many trivial elocks (canuse/1, where &canuse=1) */ if (zone != NOTHING) { struct boolexp *key = getlock(zone, Zone_Lock); if (key == TRUE_BOOLEXP) { ! notify(player, T("ZMOs must be zone-locked before you @chzone!")); ! return; ! } ! /* Does the player's location pass it? If so, we have either ! * an inexact or trivial elock */ ! if (eval_lock(Location(player), zone, Zone_Lock)) { /* Does #0 and #2 pass it? If so, probably trivial elock */ if (eval_lock(PLAYER_START, zone, Zone_Lock) && eval_lock(MASTER_ROOM, zone, Zone_Lock)) { --- 384,399 ---- return; } /* Don't allow chzone to objects without elocks! + * If no lock is set, set a default lock and warn. * This checks for many trivial elocks (canuse/1, where &canuse=1) */ if (zone != NOTHING) { struct boolexp *key = getlock(zone, Zone_Lock); if (key == TRUE_BOOLEXP) { ! add_lock(zone, Zone_Lock, parse_boolexp(zone, "$me")); ! notify(player, ! T("Unlocked ZMO - automatically zone-locking ZMO to its owner")); ! } else if (eval_lock(Location(player), zone, Zone_Lock)) { /* Does #0 and #2 pass it? If so, probably trivial elock */ if (eval_lock(PLAYER_START, zone, Zone_Lock) && eval_lock(MASTER_ROOM, zone, Zone_Lock)) { *** 1_7_4.200/src/predicat.c Sun, 22 Jul 2001 08:59:28 -0500 dunemush (pennmush/b/44_predicat.c 1.1.1.34.1.1.1.3.1.4 660) --- 1_7_4.209(w)/src/predicat.c Fri, 15 Feb 2002 08:43:09 -0600 dunemush (pennmush/b/44_predicat.c 1.1.1.34.1.1.1.3.1.4.2.1.1.1 660) *************** *** 39,47 **** #include "ansi.h" #include "parse.h" #include "dbdefs.h" - #ifdef MEM_CHECK - #include "memcheck.h" - #endif #include "privtab.h" #include "mymalloc.h" #include "confmagic.h" --- 39,44 ---- *************** *** 734,743 **** any = 1; tbuf1 = replace_string("#$", expression, argv[a + 1]); parse_que(player, tbuf1, cause); ! free(tbuf1); ! #ifdef MEM_CHECK ! del_check("replace_string.buff"); ! #endif } } --- 731,737 ---- any = 1; tbuf1 = replace_string("#$", expression, argv[a + 1]); parse_que(player, tbuf1, cause); ! mush_free(tbuf1, "replace_string.buff"); } } *************** *** 745,754 **** if ((a < MAX_ARG) && !any && argv[a]) { tbuf1 = replace_string("#$", expression, argv[a]); parse_que(player, tbuf1, cause); ! free(tbuf1); ! #ifdef MEM_CHECK ! del_check("replace_string.buff"); ! #endif } /* Pop on @notify me, if requested */ --- 739,745 ---- if ((a < MAX_ARG) && !any && argv[a]) { tbuf1 = replace_string("#$", expression, argv[a]); parse_que(player, tbuf1, cause); ! mush_free(tbuf1, "replace_string.buff"); } /* Pop on @notify me, if requested */ *** 1_7_4.200/src/parse.c Sun, 06 Jan 2002 20:44:30 -0600 dunemush (pennmush/b/48_parse.c 1.23.1.10.1.2 660) --- 1_7_4.209(w)/src/parse.c Fri, 15 Feb 2002 08:43:09 -0600 dunemush (pennmush/b/48_parse.c 1.23.1.10.1.2.1.1.1.1 660) *************** *** 400,405 **** --- 400,410 ---- pe_info->nest_depth++; } } + + /* Only strip command braces if the first character is a brace. */ + if (**str != '{') + eflags &= ~PE_COMMAND_BRACES; + for (;;) { /* Find the first "interesting" character */ { *************** *** 665,682 **** (*str)++; break; } ! if (!(eflags & PE_STRIP_BRACES)) safe_chr('{', buff, bp); (*str)++; process_expression(buff, bp, str, executor, caller, enactor, ! eflags & ~(PE_STRIP_BRACES | PE_FUNCTION_CHECK), PT_BRACE, pe_info); if (**str == '}') { ! if (!(eflags & PE_STRIP_BRACES)) safe_chr('}', buff, bp); (*str)++; } break; case '[': /* "[]" parse group; recurse with mandatory function check */ if (!pe_info && eflags != PE_NOTHING) { --- 670,691 ---- (*str)++; break; } ! if (!(eflags & (PE_STRIP_BRACES | PE_COMMAND_BRACES))) safe_chr('{', buff, bp); (*str)++; process_expression(buff, bp, str, executor, caller, enactor, ! eflags & PE_COMMAND_BRACES ! ? (eflags & ~PE_COMMAND_BRACES) ! : (eflags & ~(PE_STRIP_BRACES | PE_FUNCTION_CHECK)), PT_BRACE, pe_info); if (**str == '}') { ! if (!(eflags & (PE_STRIP_BRACES | PE_COMMAND_BRACES))) safe_chr('}', buff, bp); (*str)++; } + /* Only strip one set of braces for commands */ + eflags &= ~PE_COMMAND_BRACES; break; case '[': /* "[]" parse group; recurse with mandatory function check */ if (!pe_info && eflags != PE_NOTHING) { *** 1_7_4.200/src/game.c Fri, 07 Dec 2001 23:26:07 -0600 dunemush (pennmush/c/10_game.c 1.50.1.8.1.1.1.1.2.1.1.1.2.1.1.4.1.1.1.1.1.1.1.1 660) --- 1_7_4.209(w)/src/game.c Fri, 15 Feb 2002 08:43:08 -0600 dunemush (pennmush/c/10_game.c 1.50.1.8.1.1.1.1.2.1.1.1.2.1.1.4.1.1.1.1.1.1.1.1.1.1.2.1.1.1 660) *************** *** 119,125 **** int loc_alias_check _((dbref loc, const char *command, const char *type)); void do_poor _((dbref player, char *arg1)); void do_writelog _((dbref player, char *str, int ltype)); ! void bind_and_queue _((dbref player, dbref cause, char *action, char *arg)); void do_scan _((dbref player, char *command, int flag)); void do_list _((dbref player, char *arg, int lc)); void do_dolist _((dbref player, char *list, char *command, --- 119,126 ---- int loc_alias_check _((dbref loc, const char *command, const char *type)); void do_poor _((dbref player, char *arg1)); void do_writelog _((dbref player, char *str, int ltype)); ! void bind_and_queue(dbref player, dbref cause, char *action, const char *arg, ! const char *placestr); void do_scan _((dbref player, char *command, int flag)); void do_list _((dbref player, char *arg, int lc)); void do_dolist _((dbref player, char *list, char *command, *************** *** 260,267 **** } if (Wizard(player)) { flag_broadcast(0, 0, T("GAME: Shutdown by %s"), Name(player)); ! do_log(LT_ERR, player, NOTHING, T("SHUTDOWN by %s\n"), ! real_unparse(player, player, 0, 0)); /* This will create a file used to check if a restart should occur */ #ifdef AUTORESTART --- 261,268 ---- } if (Wizard(player)) { flag_broadcast(0, 0, T("GAME: Shutdown by %s"), Name(player)); ! do_log(LT_ERR, player, NOTHING, T("SHUTDOWN by %s(%s)\n"), ! Name(player), unparse_dbref(player)); /* This will create a file used to check if a restart should occur */ #ifdef AUTORESTART *************** *** 1239,1268 **** /* Bind occurences of '##' in "action" to "arg", then run "action" */ void ! bind_and_queue(player, cause, action, arg) ! dbref player; ! dbref cause; ! char *action; ! char *arg; { char *repl, *command; - repl = replace_string("##", arg, action); command = strip_braces(repl); ! if (repl) ! free(repl); ! #ifdef MEM_CHECK ! del_check("replace_string.buff"); ! #endif parse_que(player, command, cause); ! if (command) ! free(command); ! #ifdef MEM_CHECK ! del_check("strip_braces.buff"); ! #endif } void --- 1240,1263 ---- /* Bind occurences of '##' in "action" to "arg", then run "action" */ void ! bind_and_queue(dbref player, dbref cause, char *action, const char *arg, ! const char *placestr) { char *repl, *command; + const char *replace[2]; + + replace[0] = arg; + replace[1] = placestr; + + repl = replace_string2(standard_tokens, replace, action); command = strip_braces(repl); ! mush_free(repl, "replace_string.buff"); parse_que(player, command, cause); ! mush_free(command, "strip_braces.buff"); } void *************** *** 1393,1407 **** #define DOL_DELIM 4 void ! do_dolist(player, list, command, cause, flags) ! dbref player; ! char *list, *command; ! dbref cause; ! unsigned int flags; { char *curr, *objstring; char outbuf[BUFFER_LEN]; ! char *ebuf1, *ebuf2, *bp; int place; char placestr[10]; int j; --- 1388,1399 ---- #define DOL_DELIM 4 void ! do_dolist(dbref player, char *list, char *command, dbref cause, ! unsigned int flags) { char *curr, *objstring; char outbuf[BUFFER_LEN]; ! char *bp; int place; char placestr[10]; int j; *************** *** 1416,1422 **** if (flags & DOL_DELIM) { if (list[1] != ' ') { ! notify(player, T("Seperator must be one character.")); if (flags & DOL_NOTIFY) parse_que(player, "@notify me", cause); return; --- 1408,1414 ---- if (flags & DOL_DELIM) { if (list[1] != ' ') { ! notify(player, T("Separator must be one character.")); if (flags & DOL_NOTIFY) parse_que(player, "@notify me", cause); return; *************** *** 1453,1481 **** if (!(flags & DOL_MAP)) { /* @dolist, queue command */ ! ebuf1 = replace_string("#@", placestr, command); ! bind_and_queue(player, cause, ebuf1, curr); ! #ifdef MEM_CHECK ! del_check("replace_string.buff"); ! #endif ! free(ebuf1); } else { /* it's @map, add to the output list */ if (bp != outbuf) safe_chr(delim, outbuf, &bp); ! ebuf1 = replace_string("##", curr, command); ! ebuf2 = replace_string("#@", placestr, ebuf1); ! free(ebuf1); ! #ifdef MEM_CHECK ! del_check("replace_string.buff"); ! #endif ! ebuf1 = ebuf2; ! process_expression(outbuf, &bp, (char const **) &ebuf1, player, cause, cause, PE_DEFAULT, PT_DEFAULT, NULL); ! free(ebuf2); ! #ifdef MEM_CHECK ! del_check("replace_string.buff"); ! #endif } } --- 1445,1464 ---- if (!(flags & DOL_MAP)) { /* @dolist, queue command */ ! bind_and_queue(player, cause, command, curr, placestr); } else { + const char *replace[2]; + char *ebuf; + /* it's @map, add to the output list */ if (bp != outbuf) safe_chr(delim, outbuf, &bp); ! replace[0] = curr; ! replace[1] = placestr; ! ebuf = replace_string2(standard_tokens, replace, command); ! process_expression(outbuf, &bp, (char const **) &ebuf, player, cause, cause, PE_DEFAULT, PT_DEFAULT, NULL); ! mush_free(ebuf, "replace_string.buff"); } } *** 1_7_4.200/src/funlist.c Wed, 23 Jan 2002 10:11:06 -0600 dunemush (pennmush/c/16_funlist.c 1.3.1.1.1.5.1.2.1.1.1.1.1.4.1.2.1.2.1.19.1.2.1.1.1.2.1.5.1.1.1.1.1.1.1.1 660) --- 1_7_4.209(w)/src/funlist.c Fri, 15 Feb 2002 08:43:08 -0600 dunemush (pennmush/c/16_funlist.c 1.3.1.1.1.5.1.2.1.1.1.1.1.4.1.2.1.2.1.19.1.2.1.1.1.2.1.5.1.1.1.1.1.1.1.1.1.1.2.1.1.1 660) *************** *** 997,1009 **** if (!delim_check(buff, bp, nargs, args, 3, &sep)) return; ! tempbuff = (char *) mush_malloc(BUFFER_LEN * 2, "string"); a1 = (char **) mush_malloc(MAX_SORTSIZE * sizeof(char *), "ptrarray"); a2 = (char **) mush_malloc(MAX_SORTSIZE * sizeof(char *), "ptrarray"); if (!tempbuff || !a1 || !a2) panic("Unable to allocate memory in fun_setunion"); /* Concat both lists, make array, sort */ ! sprintf(tempbuff, "%s%c%s", args[0], sep, args[1]); n1 = list2arr(a1, MAX_SORTSIZE, tempbuff, sep); if (nargs == 4) sort_type = get_list_type(args, nargs, 4, a1, n1); --- 997,1014 ---- if (!delim_check(buff, bp, nargs, args, 3, &sep)) return; ! tempbuff = (char *) mush_malloc((BUFFER_LEN * 2) + 4, "string"); a1 = (char **) mush_malloc(MAX_SORTSIZE * sizeof(char *), "ptrarray"); a2 = (char **) mush_malloc(MAX_SORTSIZE * sizeof(char *), "ptrarray"); if (!tempbuff || !a1 || !a2) panic("Unable to allocate memory in fun_setunion"); /* Concat both lists, make array, sort */ ! if (!*args[0]) ! strcpy(tempbuff, args[1]); ! else if (!*args[1]) ! strcpy(tempbuff, args[0]); ! else ! sprintf(tempbuff, "%s%c%s", args[0], sep, args[1]); n1 = list2arr(a1, MAX_SORTSIZE, tempbuff, sep); if (nargs == 4) sort_type = get_list_type(args, nargs, 4, a1, n1); *************** *** 1013,1020 **** /* Strip the duplicates and make a2 contain the list */ a = 0; for (i = 0; i < n1; i++) { ! if (((a == 0) || (gencomp(a1[i], a2[a - 1], sort_type) != 0)) ! && (*a1[i])) { a2[a] = a1[i]; a++; } --- 1018,1024 ---- /* Strip the duplicates and make a2 contain the list */ a = 0; for (i = 0; i < n1; i++) { ! if (((a == 0) || (gencomp(a1[i], a2[a - 1], sort_type) != 0))) { a2[a] = a1[i]; a++; } *************** *** 1926,1931 **** --- 1930,1937 ---- int *place; int funccount; char *oldbp; + const char *replace[2]; + if (inum >= MAX_ITERS) { safe_str(T("#-1 TOO MANY ITERS"), buff, bp); *************** *** 1985,1997 **** } *place = *place + 1; iter_rep[inum] = tbuf1 = split_token(&lp, sep); ! tbuf2 = replace_string("##", tbuf1, args[1]); ! tbuf1 = replace_string("#@", unparse_integer(*place), tbuf2); ! mush_free((Malloc_t) tbuf2, "replace_string.buff"); ! sp = tbuf1; process_expression(buff, bp, &sp, executor, caller, enactor, PE_DEFAULT, PT_DEFAULT, pe_info); ! mush_free((Malloc_t) tbuf1, "replace_string.buff"); } *place = 0; iter_rep[inum] = NULL; --- 1991,2003 ---- } *place = *place + 1; iter_rep[inum] = tbuf1 = split_token(&lp, sep); ! replace[0] = tbuf1; ! replace[1] = unparse_integer(*place); ! tbuf2 = replace_string2(standard_tokens, replace, args[1]); ! sp = tbuf2; process_expression(buff, bp, &sp, executor, caller, enactor, PE_DEFAULT, PT_DEFAULT, pe_info); ! mush_free((Malloc_t) tbuf2, "replace_string.buff"); } *place = 0; iter_rep[inum] = NULL; *** 1_7_4.200/src/destroy.c Wed, 26 Sep 2001 13:44:35 -0500 dunemush (pennmush/c/24_destroy.c 1.24.2.2.1.3 660) --- 1_7_4.209(w)/src/destroy.c Fri, 15 Feb 2002 08:43:07 -0600 dunemush (pennmush/c/24_destroy.c 1.24.2.2.1.3.1.1 660) *************** *** 347,353 **** case TYPE_PLAYER: /* wait until dbck */ notify_format(player, ! T("%s and all their objects are scheduled to be destroyed."), object_header(player, thing)); break; case TYPE_THING: --- 347,360 ---- case TYPE_PLAYER: /* wait until dbck */ notify_format(player, ! (DESTROY_POSSESSIONS ? ! (REALLY_SAFE ? ! T ! ("%s and all their (non-SAFE) objects are scheduled to be destroyed.") ! : ! T ! ("%s and all their objects are scheduled to be destroyed.")) ! : T("%s is scheduled to be destroyed.")), object_header(player, thing)); break; case TYPE_THING: *** 1_7_4.200/src/db.c Wed, 23 Jan 2002 10:11:06 -0600 dunemush (pennmush/c/25_db.c 1.26.1.1.1.1 660) --- 1_7_4.209(w)/src/db.c Fri, 15 Feb 2002 08:43:07 -0600 dunemush (pennmush/c/25_db.c 1.26.1.1.1.1.1.1 660) *************** *** 147,153 **** db_size *= 2; if ((newdb = (struct object *) realloc(db, db_size * sizeof(struct object))) == NULL) { ! do_rawlog(LT_ERR, "ERROR: out of memory wile extending database!"); abort(); } db = newdb; --- 147,153 ---- db_size *= 2; if ((newdb = (struct object *) realloc(db, db_size * sizeof(struct object))) == NULL) { ! do_rawlog(LT_ERR, "ERROR: out of memory while extending database!"); abort(); } db = newdb; *** 1_7_4.200/src/command.c Thu, 08 Nov 2001 14:56:16 -0600 dunemush (pennmush/c/36_command.c 1.56.1.1.1.1.1.1.1.2.1.1.1.1.1.5.1.2 660) --- 1_7_4.209(w)/src/command.c Fri, 15 Feb 2002 08:43:07 -0600 dunemush (pennmush/c/36_command.c 1.56.1.1.1.1.1.1.1.2.1.1.1.1.1.5.1.2.1.1 660) *************** *** 684,690 **** if (parse || forcenoparse) parse = PE_NOTHING; else ! parse = PE_DEFAULT; if (right_side) split = PT_NOTHING; --- 684,690 ---- if (parse || forcenoparse) parse = PE_NOTHING; else ! parse = PE_DEFAULT | PE_COMMAND_BRACES; if (right_side) split = PT_NOTHING; *************** *** 704,710 **** } if ((parse == PE_NOTHING) && args) ! parse = PE_STRIP_BRACES; i = 1; done = 0; --- 704,710 ---- } if ((parse == PE_NOTHING) && args) ! parse = PE_COMMAND_BRACES; i = 1; done = 0; *************** *** 877,884 **** c = command; while (*p == ' ') p++; ! process_expression(command, &c, (const char **) &p, player, cause, ! cause, PE_DEFAULT & ~PE_FUNCTION_CHECK, PT_SPACE, NULL); *c = '\0'; strcpy(commandraw, command); upcasestr(command); --- 877,885 ---- c = command; while (*p == ' ') p++; ! process_expression(command, &c, (const char **) &p, player, cause, cause, ! (PE_DEFAULT & ~PE_FUNCTION_CHECK) | PE_COMMAND_BRACES, ! PT_SPACE, NULL); *c = '\0'; strcpy(commandraw, command); upcasestr(command); *************** *** 939,946 **** p++; } process_expression(commandraw, &c, (const char **) &p, player, cause, ! cause, PE_DEFAULT & ~PE_FUNCTION_CHECK, PT_DEFAULT, ! NULL); } *c = '\0'; mush_free((Malloc_t) command, "string"); --- 940,948 ---- p++; } process_expression(commandraw, &c, (const char **) &p, player, cause, ! cause, ! (PE_DEFAULT & ~PE_FUNCTION_CHECK) | PE_COMMAND_BRACES, ! PT_DEFAULT, NULL); } *c = '\0'; mush_free((Malloc_t) command, "string"); *** 1_7_4.200/hdrs/version.h Fri, 04 Jan 2002 14:28:24 -0600 dunemush (pennmush/c/47_version.h 1.32.1.2.1.7.1.9.1.1.1.1.1.3 660) --- 1_7_4.209(w)/hdrs/version.h Fri, 15 Feb 2002 08:43:10 -0600 dunemush (pennmush/c/47_version.h 1.32.1.2.1.7.1.9.1.1.1.1.1.4 660) *************** *** 1,2 **** ! #define VERSION "PennMUSH version 1.7.4 patchlevel 14 [01/04/2002]" ! #define SHORTVN "PennMUSH 1.7.4p14" --- 1,2 ---- ! #define VERSION "PennMUSH version 1.7.4 patchlevel 15 [02/08/2002]" ! #define SHORTVN "PennMUSH 1.7.4p15" *** 1_7_4.200/hdrs/parse.h Thu, 19 Jul 2001 14:15:24 -0500 dunemush (pennmush/c/51_parse.h 1.10 660) --- 1_7_4.209(w)/hdrs/parse.h Fri, 15 Feb 2002 08:43:10 -0600 dunemush (pennmush/c/51_parse.h 1.10.1.1 660) *************** *** 184,189 **** --- 184,190 ---- #define PE_NOTHING 0 #define PE_COMPRESS_SPACES 0x00000001 #define PE_STRIP_BRACES 0x00000002 + #define PE_COMMAND_BRACES 0x00000004 #define PE_EVALUATE 0x00000010 #define PE_FUNCTION_CHECK 0x00000020 #define PE_FUNCTION_MANDATORY 0x00000040 *** 1_7_4.200/hdrs/externs.h Mon, 13 Aug 2001 19:51:56 -0500 dunemush (pennmush/d/16_externs.h 1.1.1.53.1.2.1.8 660) --- 1_7_4.209(w)/hdrs/externs.h Fri, 15 Feb 2002 08:43:10 -0600 dunemush (pennmush/d/16_externs.h 1.1.1.53.1.2.1.8.2.1.1.1 660) *************** *** 347,364 **** #define safe_ansi(src, copylen, buff, bp) \ safe_ansi_len((src), (copylen), (buff), (bp), BUFFER_LEN) extern char *replace_string ! _((const char *old, const char *newbit, const char *string)); ! extern char *trim_space_sep _((char *str, char sep)); ! extern int do_wordcount _((char *str, char sep)); ! extern int minmatch _((const char *str, const char *target, int min)); ! extern char *remove_word _((char *list, char *word, char sep)); ! extern char *next_in_list _((char **head)); #define safe_str(s,b,p) safe_copy_str(s,b,p,BUFFER_LEN - 1) #define safe_short_str(s,b,p) safe_copy_str(s,b,p,SBUF_LEN - 1) ! extern int ansi_strlen _((char *string)); ! extern int ansi_strnlen _((char *string, unsigned int numchars)); /* From unparse.c */ const char *real_unparse --- 347,367 ---- #define safe_ansi(src, copylen, buff, bp) \ safe_ansi_len((src), (copylen), (buff), (bp), BUFFER_LEN) extern char *replace_string ! (const char *old, const char *newbit, const char *string); ! extern char *replace_string2 ! (const char *old[2], const char *newbits[2], const char *string); ! extern const char *standard_tokens[2]; /* ## and #@ */ ! extern char *trim_space_sep(char *str, char sep); ! extern int do_wordcount(char *str, char sep); ! extern int minmatch(const char *str, const char *target, int min); ! extern char *remove_word(char *list, char *word, char sep); ! extern char *next_in_list(char **head); #define safe_str(s,b,p) safe_copy_str(s,b,p,BUFFER_LEN - 1) #define safe_short_str(s,b,p) safe_copy_str(s,b,p,SBUF_LEN - 1) ! extern int ansi_strlen(const char *string); ! extern int ansi_strnlen(const char *string, Size_t numchars); /* From unparse.c */ const char *real_unparse *** 1_7_4.200/po/Makefile Wed, 10 Jan 2001 15:58:47 -0600 dunemush (pennmush/e/47_Makefile 1.7 660) --- 1_7_4.209(w)/po/Makefile Tue, 12 Feb 2002 14:21:41 -0600 dunemush (pennmush/e/47_Makefile 1.7 660) *************** *** 4,17 **** da_DK.po de_DE.po no_NO.po .pox.po: $*.pox pennmush.pot ! msgmerge $*.pox pennmush.pot > $*.po po-files: $(POFILES) localized: $(LANG).po ! @msgfmt --strict $(LANG).po -mkdir -p $(LANG)/LC_MESSAGES ! @mv messages.mo $(LANG)/LC_MESSAGES/pennmush.mo .po: @echo "No LANG variable set, no localization. Ignore errors." --- 4,17 ---- da_DK.po de_DE.po no_NO.po .pox.po: $*.pox pennmush.pot ! -msgmerge $*.pox pennmush.pot > $*.po po-files: $(POFILES) localized: $(LANG).po ! -msgfmt --strict $(LANG).po -mkdir -p $(LANG)/LC_MESSAGES ! -mv messages.mo $(LANG)/LC_MESSAGES/pennmush.mo .po: @echo "No LANG variable set, no localization. Ignore errors."