This is patch06 to PennMUSH 1.8.0. After applying this patch, you will have version 1.8.0p6 To apply this patch, save it to a file in your top-level MUSH directory, and do the following: patch -p1 < 1.8.0-patch06 make clean 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. On the off chance they appear not to be, simply rm them and re-run make. Then @shutdown and restart your MUSH. - Alan/Javelin In this patch: Fixes: * Weird logging ouput with function logargs fixed. Report by Sholevi@M*U*S*H. * sort() and set functions now ignore ansi. Patch by Walker@M*U*S*H. * @hook memory leak fixed. Reported by Shari@M*U*S*H. Prereq: 1.8.0p5 *** 1_8_0.54/Patchlevel Mon, 30 May 2005 15:53:13 -0500 dunemush (pennmush/5_Patchlevel 1.17.1.11.1.43.1.5 600) --- 1_8_0.61(w)/Patchlevel Fri, 24 Jun 2005 07:52:56 -0500 dunemush (pennmush/5_Patchlevel 1.17.1.11.1.43.1.6 600) *************** *** 1,2 **** Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.8.0p5 --- 1,2 ---- Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.8.0p6 *** 1_8_0.54/src/parse.c Thu, 02 Sep 2004 11:04:56 -0500 dunemush (pennmush/b/48_parse.c 1.23.1.10.1.2.1.1.1.1.1.2.1.2.1.41 660) --- 1_8_0.61(w)/src/parse.c Sat, 25 Jun 2005 12:43:57 -0500 dunemush (pennmush/b/48_parse.c 1.23.1.10.1.2.1.1.1.1.1.2.1.2.1.41.1.1 660) *************** *** 1133,1139 **** for (logi = 0; logi < nfargs; logi++) { safe_str(fargs[logi], logstr, &logp); if (logi + 1 < nfargs) ! safe_str(fargs[logi], logstr, &logp); } safe_chr(')', logstr, &logp); *logp = '\0'; --- 1133,1139 ---- for (logi = 0; logi < nfargs; logi++) { safe_str(fargs[logi], logstr, &logp); if (logi + 1 < nfargs) ! safe_chr(',', logstr, &logp); } safe_chr(')', logstr, &logp); *logp = '\0'; *** 1_8_0.54/src/funlist.c Sat, 04 Jun 2005 14:30:47 -0500 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.3.1.2.1.1.1.1.1.1.1.1.1.1.1.12.1.14.1.7.1.20.1.1 660) --- 1_8_0.61(w)/src/funlist.c Sat, 25 Jun 2005 12:43:57 -0500 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.3.1.2.1.1.1.1.1.1.1.1.1.1.1.12.1.14.1.7.1.20.1.1.1.1.1.1 660) *************** *** 10,15 **** --- 10,16 ---- #include "config.h" #include #include + #include "ansi.h" #include "conf.h" #include "case.h" #include "externs.h" *************** *** 789,795 **** GENRECORD(gen_alphanum) { ! rec->str = rec->val; } GENRECORD(gen_dbref) --- 790,802 ---- GENRECORD(gen_alphanum) { ! int len; ! if (strchr(rec->val, ESC_CHAR)) { ! rec->str = mush_strdup(remove_markup(rec->val, &len), "genrecord"); ! rec->freestr = 1; ! } else { ! rec->str = rec->val; ! } } GENRECORD(gen_dbref) *** 1_8_0.54/src/function.c Fri, 03 Dec 2004 17:50:18 -0600 dunemush (pennmush/c/18_function.c 1.29.1.14.1.3.1.6.1.1.1.1.1.14.1.2.1.1.1.7.1.22.1.11.1.3.1.24.1.4.1.2 660) --- 1_8_0.61(w)/src/function.c Sat, 25 Jun 2005 12:43:57 -0500 dunemush (pennmush/c/18_function.c 1.29.1.14.1.3.1.6.1.1.1.1.1.14.1.2.1.1.1.7.1.22.1.11.1.3.1.24.1.4.1.2.2.1.1.1.1.1 660) *************** *** 71,82 **** --- 71,109 ---- if (preserve[i]) { strcpy(global_eval_context.renv[i], preserve[i]); mush_free(preserve[i], funcname); + preserve[i] = NULL; } else { global_eval_context.renv[i][0] = '\0'; } } } + /** Free the storage array for the q-registers, without restoring + * \param funcname name of function calling (for memory leak testing) + * \param preserve pointer to array to free q-registers from. + */ + void + free_global_regs(const char *funcname, char *preserve[]) + { + int i; + for (i = 0; i < NUMQ; i++) { + if (preserve[i]) + mush_free(preserve[i], funcname); + } + } + + /** Initilalize an array for the q-registers, setting all NULL. + * \param preserve pointer to array to free q-registers from. + */ + void + init_global_regs(char *preserve[]) + { + int i; + for (i = 0; i < NUMQ; i++) { + preserve[i] = NULL; + } + } + /** Restore the q-registers, without freeing the storage array. * \param preserve pointer to array to restore the q-registers from. */ *** 1_8_0.54/src/command.c Sat, 04 Jun 2005 22:07:33 -0500 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.1.1.1.2.1.3.1.10.1.1.3.74.1.6.1.3.1.1 660) --- 1_8_0.61(w)/src/command.c Sat, 25 Jun 2005 12:43:57 -0500 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.1.1.1.2.1.3.1.10.1.1.3.74.1.6.1.3.1.1.1.1.1.1 660) *************** *** 1170,1176 **** do_rawlog(LT_ERR, T("No command vector on command %s."), cmd->name); return NULL; } else { ! char *saveregs[NUMQ] = { NULL }; /* If we have a hook/ignore that returns false, we don't do the command */ if (run_hook(player, cause, &cmd->hooks.ignore, saveregs, 1)) { /* If we have a hook/override, we use that instead */ --- 1170,1177 ---- do_rawlog(LT_ERR, T("No command vector on command %s."), cmd->name); return NULL; } else { ! char *saveregs[NUMQ]; ! init_global_regs(saveregs); /* If we have a hook/ignore that returns false, we don't do the command */ if (run_hook(player, cause, &cmd->hooks.ignore, saveregs, 1)) { /* If we have a hook/override, we use that instead */ *************** *** 1190,1195 **** --- 1191,1197 ---- } else { retval = commandraw; } + free_global_regs("hook.regs", saveregs); } command_parse_free_args; *************** *** 1207,1216 **** generic_command_failure(dbref player, dbref cause, char *string) { COMMAND_INFO *cmd; ! char *saveregs[NUMQ] = { NULL }; if ((cmd = command_find("HUH_COMMAND"))) { if (!(cmd->type & CMD_T_DISABLED)) { if (run_hook(player, cause, &cmd->hooks.ignore, saveregs, 1)) { /* If we have a hook/override, we use that instead */ if (!has_hook(&cmd->hooks.override) || --- 1209,1219 ---- generic_command_failure(dbref player, dbref cause, char *string) { COMMAND_INFO *cmd; ! char *saveregs[NUMQ]; if ((cmd = command_find("HUH_COMMAND"))) { if (!(cmd->type & CMD_T_DISABLED)) { + init_global_regs(saveregs); if (run_hook(player, cause, &cmd->hooks.ignore, saveregs, 1)) { /* If we have a hook/override, we use that instead */ if (!has_hook(&cmd->hooks.override) || *************** *** 1226,1231 **** --- 1229,1235 ---- if (cmd->type & CMD_T_LOGARGS) do_log(LT_HUH, player, cause, "%s", string); } + free_global_regs("hook.regs", saveregs); } } } *** 1_8_0.54/src/access.c Thu, 02 Jun 2005 14:57:20 -0500 dunemush (pennmush/c/43_access.c 1.11.1.2.1.4.1.13 660) --- 1_8_0.61(w)/src/access.c Sat, 25 Jun 2005 12:43:57 -0500 dunemush (pennmush/c/43_access.c 1.11.1.2.1.4.1.14 660) *************** *** 281,286 **** --- 281,287 ---- return; } + #ifdef FORCE_IPV4 static char * ip4_to_ip6(const char *addr) { *************** *** 291,296 **** --- 292,298 ---- *bp = '\0'; return tbuf1; } + #endif /** Decide if a host can access someway. *** 1_8_0.54/hdrs/version.h Mon, 30 May 2005 15:53:13 -0500 dunemush (pennmush/c/47_version.h 1.32.1.2.1.7.1.9.1.1.1.17.1.45.1.6 660) --- 1_8_0.61(w)/hdrs/version.h Sat, 25 Jun 2005 12:43:58 -0500 dunemush (pennmush/c/47_version.h 1.32.1.2.1.7.1.9.1.1.1.17.1.45.1.7 660) *************** *** 1,4 **** #define VERSION "1.8.0" ! #define PATCHLEVEL "5" ! #define PATCHDATE "[05/30/2005]" ! #define NUMVERSION 1008000005 --- 1,4 ---- #define VERSION "1.8.0" ! #define PATCHLEVEL "6" ! #define PATCHDATE "[06/24/2005]" ! #define NUMVERSION 1008000006 *** 1_8_0.54/hdrs/externs.h Thu, 02 Sep 2004 11:04:56 -0500 dunemush (pennmush/d/16_externs.h 1.1.1.53.1.2.1.8.2.1.1.2.1.1.1.1.1.2.1.6.1.3.1.4.3.1.1.1.1.18.1.8.1.1.1.32.1.1 660) --- 1_8_0.61(w)/hdrs/externs.h Sat, 25 Jun 2005 12:43:57 -0500 dunemush (pennmush/d/16_externs.h 1.1.1.53.1.2.1.8.2.1.1.2.1.1.1.1.1.2.1.6.1.3.1.4.3.1.1.1.1.18.1.8.1.1.1.32.1.1.3.1.1.1 660) *************** *** 569,574 **** --- 569,576 ---- extern char *strip_braces(char const *line); extern void save_global_regs(const char *funcname, char *preserve[]); extern void restore_global_regs(const char *funcname, char *preserve[]); + extern void free_global_regs(const char *funcname, char *preserve[]); + extern void init_global_regs(char *preserve[]); extern void load_global_regs(char *preserve[]); extern void save_global_env(const char *funcname, char *preserve[]); extern void restore_global_env(const char *funcname, char *preserve[]); *** 1_8_0.54/game/txt/hlp/pennvOLD.hlp Sun, 20 Mar 2005 13:48:57 -0600 dunemush (pennmush/g/30_pennvOLD.h 1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.9.1.2.1.5.1.1.1.1.1.1.1.1 660) --- 1_8_0.61(w)/game/txt/hlp/pennvOLD.hlp Sat, 25 Jun 2005 12:43:58 -0500 dunemush (pennmush/g/30_pennvOLD.h 1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.9.1.2.1.5.1.1.1.1.1.1.1.1.1.1 660) *************** *** 4417,4423 **** For information on a specific patchlevel of one of the versions listed, type 'help p'. For example, 'help 1.7.2p3' ! 1.8.0: 0, 1, 2, 3, 4, 5 1.7.7: 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, 36, 37, 38, 39, 40 --- 4417,4423 ---- For information on a specific patchlevel of one of the versions listed, type 'help p'. For example, 'help 1.7.2p3' ! 1.8.0: 0, 1, 2, 3, 4, 5, 6 1.7.7: 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, 36, 37, 38, 39, 40 *** 1_8_0.54/game/txt/hlp/pennv180.hlp Sat, 04 Jun 2005 22:07:33 -0500 dunemush (pennmush/h/28_pennv180.h 1.1.1.2.1.1.1.2.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.4.1.1.1.1.1.1.1.1 660) --- 1_8_0.61(w)/game/txt/hlp/pennv180.hlp Sat, 25 Jun 2005 12:43:58 -0500 dunemush (pennmush/h/28_pennv180.h 1.1.1.2.1.1.1.2.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.4.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1 660) *************** *** 1,4 **** ! & 1.8.0p5 & changes This is a list of changes in this patchlevel which are probably of interest to players. More information about new commands and functions --- 1,4 ---- ! & 1.8.0p6 & changes This is a list of changes in this patchlevel which are probably of interest to players. More information about new commands and functions *************** *** 11,16 **** --- 11,25 ---- A list of the patchlevels associated with each release can be read in 'help patchlevels'. + Version 1.8.0 patchlevel 6 June 24, 2005 + + Fixes: + * Weird logging ouput with function logargs fixed. Report by Sholevi@M*U*S*H. + * sort() and set functions now ignore ansi. Patch by Walker@M*U*S*H. + * @hook memory leak fixed. Reported by Shari@M*U*S*H. + + + & 1.8.0p5 Version 1.8.0 patchlevel 5 May 30, 2005 Minor changes: *** 1_8_0.54/CHANGES.180 Sat, 04 Jun 2005 22:07:33 -0500 dunemush (pennmush/h/21_CHANGES.18 1.35 600) --- 1_8_0.61(w)/CHANGES.180 Fri, 24 Jun 2005 07:53:02 -0500 dunemush (pennmush/h/21_CHANGES.18 1.39 600) *************** *** 12,17 **** --- 12,25 ---- ========================================================================== + Version 1.8.0 patchlevel 6 June 24, 2005 + + Fixes: + * Weird logging ouput with function logargs fixed. Report by Sholevi@M*U*S*H. + * sort() and set functions now ignore ansi. Patch by Walker@M*U*S*H. + * @hook memory leak fixed. Reported by Shari@M*U*S*H. + + Version 1.8.0 patchlevel 5 May 30, 2005 Minor changes: