This is patch07 to PennMUSH 1.8.2. After applying this patch, you will have version 1.8.2p7 To apply this patch, save it to a file in your top-level 1.8.2p6 MUSH directory, and do the following: patch -p0 < 1.8.2-patch07 make update make install If you use GNU patch 2.2, you probably want the above to be 'patch -b -p0', not just 'patch -p0'. 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. - Shawn/Raevnos In this patch: Minor changes: * nwho() now takes an optional viewer argument like lwho(). By Sketch. Fixes: * Clarified the behavior of eval() and get_eval() in help. Suggested by Talvo and Javelin. * A failed db save no longer broadcasts a success message in addition to a failure one. Reported by Cooee. * The open database file wasn't getting closed on a failed save. * Crash bug in sortkey(). Fix by Nathan Baum. * 'help @desc' brings up @describe instead of @descformat. Suggested by Nymeria. * Removed mention of Win32 requiring a particular attribute compression algorithm. Any will work, and always have. Reported by Andrew Klein. * Crash bug in @purge. Javelin. Prereq: 1.8.2p6 =================================================================== --- Patchlevel (.../p6) (revision 1115) +++ Patchlevel (.../p7) (revision 1115) @@ -1,2 +1,2 @@ Do not edit this file. It is maintained by the official PennMUSH patches. -This is PennMUSH 1.8.2p6 +This is PennMUSH 1.8.2p7 Index: options.h.dist =================================================================== --- options.h.dist (.../p6) (revision 1115) +++ options.h.dist (.../p7) (revision 1115) @@ -58,7 +58,7 @@ * when decompressing, and considerably slower when compressing. * (But you decompress a lot more often). Compression ratio * is worse than Huffman for small dbs (<1.5Mb of text), but - * better for larger dbs. Win32 systems must use this. + * better for larger dbs. * 4 - Raevnos's almost 8-bit clean version of the word-based algorithm. * Prefer 3 unless you need extended characters. This algorithm * can encode all characters except 0x06. Index: src/utils.c =================================================================== --- src/utils.c (.../p6) (revision 1115) +++ src/utils.c (.../p7) (revision 1115) @@ -760,6 +760,8 @@ if (!GoodObject(room)) return NOTHING; while (!IsRoom(room)) { + if (!GoodObject(Location(room))) + return room; room = Location(room); rec++; if (rec > 20) Index: src/malias.c =================================================================== --- src/malias.c (.../p6) (revision 1115) +++ src/malias.c (.../p7) (revision 1115) @@ -139,7 +139,7 @@ return; } if (!alias || !*alias || !tolist || !*tolist) { - notify(player, T("MAIL: What alias do you want to create?.")); + notify(player, T("MAIL: What alias do you want to create?")); return; } if (*alias != MALIAS_TOKEN) { Index: src/function.c =================================================================== --- src/function.c (.../p6) (revision 1115) +++ src/function.c (.../p7) (revision 1115) @@ -524,7 +524,7 @@ {"NVEXITS", fun_dbwalker, 1, 1, FN_REG}, {"NVPLAYERS", fun_dbwalker, 1, 1, FN_REG}, {"NVTHINGS", fun_dbwalker, 1, 1, FN_REG}, - {"NWHO", fun_nwho, 0, 0, FN_REG}, + {"NWHO", fun_nwho, 0, 1, FN_REG}, {"OBJ", fun_obj, 1, 1, FN_REG}, {"OBJEVAL", fun_objeval, 2, -2, FN_NOPARSE}, {"OBJID", fun_objid, 1, 1, FN_REG}, Index: src/bsd.c =================================================================== --- src/bsd.c (.../p6) (revision 1115) +++ src/bsd.c (.../p7) (revision 1115) @@ -3851,11 +3851,28 @@ FUNCTION(fun_nwho) { DESC *d; + dbref victim; int count = 0; - int powered = (*(called_as + 1) != 'M'); + int powered = ((*(called_as + 1) != 'M') && Priv_Who(executor)); + if (nargs && args[0] && *args[0]) { + /* An argument was given. Find the victim and choose the lowest + * perms possible */ + if (!powered) { + safe_str(T(e_perm), buff, bp); + return; + } + if ((victim = noisy_match_result(executor, args[0], NOTYPE, + MAT_EVERYTHING)) == 0) { + safe_str(T(e_notvis), buff, bp); + return; + } + if (!Priv_Who(victim)) + powered = 0; + } + DESC_ITER_CONN(d) { - if (!Hidden(d) || (powered && Priv_Who(executor))) { + if (!Hidden(d) || powered) { count++; } } Index: src/extmail.c =================================================================== --- src/extmail.c (.../p6) (revision 1115) +++ src/extmail.c (.../p7) (revision 1115) @@ -2542,22 +2542,24 @@ { /* Return a longer description of message flags */ static char tbuf1[BUFFER_LEN]; + char *tp; - tbuf1[0] = '\0'; + tp = tbuf1; if (Read(mp)) - strcat(tbuf1, T("Read ")); + safe_str(T("Read "), tbuf1, &tp); else - strcat(tbuf1, T("Unread ")); + safe_str(T("Unread "), tbuf1, &tp); if (Cleared(mp)) - strcat(tbuf1, T("Cleared ")); + safe_str(T("Cleared "), tbuf1, &tp); if (Urgent(mp)) - strcat(tbuf1, T("Urgent ")); + safe_str(T("Urgent "), tbuf1, &tp); if (Mass(mp)) - strcat(tbuf1, T("Mass ")); + safe_str(T("Mass "), tbuf1, &tp); if (Forward(mp)) - strcat(tbuf1, T("Fwd ")); + safe_str(T("Fwd "), tbuf1, &tp); if (Tagged(mp)) - strcat(tbuf1, T("Tagged")); + safe_str(T("Tagged"), tbuf1, &tp); + *tp = '\0'; return tbuf1; } @@ -2802,18 +2804,19 @@ return; /* Handle this now so it doesn't clutter code */ - tbuf1[0] = '\0'; + j = 0; if (flags & M_URGENT) - strcat(tbuf1, "U"); + tbuf1[j++] = 'U'; if (flags & M_FORWARD) - strcat(tbuf1, "F"); + tbuf1[j++] = 'F'; if (flags & M_REPLY) - strcat(tbuf1, "R"); + tbuf1[j++] = 'R'; + tbuf1[j] = '\0'; - arg = (char *) mush_malloc(BUFFER_LEN, "string"); - arg2 = (char *) mush_malloc(BUFFER_LEN, "string"); - arg3 = (char *) mush_malloc(BUFFER_LEN, "string"); - arg4 = (char *) mush_malloc(BUFFER_LEN, "string"); + arg = mush_malloc(BUFFER_LEN, "string"); + arg2 = mush_malloc(BUFFER_LEN, "string"); + arg3 = mush_malloc(BUFFER_LEN, "string"); + arg4 = mush_malloc(BUFFER_LEN, "string"); if (!arg4) mush_panic("Unable to allocate memory in mailfilter"); save_global_regs("filter_mail", rsave); @@ -2836,16 +2839,16 @@ process_expression(buff, &bp, &ap, player, player, player, PE_DEFAULT, PT_DEFAULT, NULL); *bp = '\0'; - free((Malloc_t) asave); + free(asave); if (*buff) { sprintf(buf, "0:%d", mailnumber); do_mail_file(player, buf, buff); } - mush_free((Malloc_t) arg, "string"); - mush_free((Malloc_t) arg2, "string"); - mush_free((Malloc_t) arg3, "string"); - mush_free((Malloc_t) arg4, "string"); + mush_free(arg, "string"); + mush_free(arg2, "string"); + mush_free(arg3, "string"); + mush_free(arg4, "string"); restore_global_env("filter_mail", wsave); restore_global_regs("filter_mail", rsave); } Index: src/htab.c =================================================================== --- src/htab.c (.../p6) (revision 1115) +++ src/htab.c (.../p7) (revision 1115) @@ -530,7 +530,7 @@ hash_stats_header(dbref player) { notify_format(player, - "Table Buckets Entries LChain ECh 1Ch 2Ch 3Ch 4+Ch AvgCh ~Memory"); + "Table Buckets Entries LChain ECh 1Ch 2Ch 3Ch 4+Ch AvgCh ~Memory"); } /** Display stats on a hashtable. @@ -553,7 +553,6 @@ for (n = 0; n < 5; n++) lengths[n] = 0; bytes += sizeof(HASHTAB); - bytes += htab->entry_size * htab->entries; if (htab->buckets) { bytes += HASHENT_SIZE * htab->hashsize; for (n = 0; n < htab->hashsize; n++) { @@ -575,7 +574,7 @@ totchains += lengths[n]; notify_format(player, - "%-10s %7d %7d %6d %4d %4d %4d %4d %4d %6.3f %7u", hname, + "%-11s %7d %7d %6d %4d %4d %4d %4d %4d %6.3f %7u", hname, htab->hashsize, htab->entries, longest, lengths[0], lengths[1], lengths[2], lengths[3], lengths[4], totchains > 0 ? chainlens / totchains : 0.0, bytes); Index: src/funlist.c =================================================================== --- src/funlist.c (.../p6) (revision 1115) +++ src/funlist.c (.../p7) (revision 1115) @@ -1239,7 +1239,7 @@ for (i = 0; i < nptrs; i++) { /* Build our %0 args */ wenv[0] = (char *) ptrs[i]; - call_ufun(&ufun, wenv, 2, result, executor, enactor, pe_info); + call_ufun(&ufun, wenv, 1, result, executor, enactor, pe_info); keys[i] = mush_strdup(result, "sortkey"); } Index: src/warnings.c =================================================================== --- src/warnings.c (.../p6) (revision 1115) +++ src/warnings.c (.../p7) (revision 1115) @@ -376,9 +376,10 @@ unparse_warnings(warn_type warns) { static char tbuf1[BUFFER_LEN]; + char *tp; int listsize, indexx; - tbuf1[0] = '\0'; + tp = tbuf1; /* Get the # of elements in checklist */ listsize = sizeof(checklist) / sizeof(tcheck); @@ -390,8 +391,8 @@ /* Which is to say: * if the bits set on the_flag is a subset of the bits set on warns */ - strcat(tbuf1, checklist[indexx].name); - strcat(tbuf1, " "); + safe_str(checklist[indexx].name, tbuf1, &tp); + safe_chr(' ', tbuf1, &tp); /* If we've got a flag which subsumes smaller ones, don't * list the smaller ones */ Index: src/player.c =================================================================== --- src/player.c (.../p6) (revision 1115) +++ src/player.c (.../p7) (revision 1115) @@ -379,7 +379,7 @@ giveto(player, START_BONUS); /* starting bonus */ (void) atr_add(player, "LAST", show_time(mudtime, 0), GOD, 0); (void) atr_add(player, "LASTSITE", host, GOD, 0); - (void) atr_add(player, "LASTIP", ip, GOD, NOTHING); + (void) atr_add(player, "LASTIP", ip, GOD, 0); (void) atr_add(player, "LASTFAILED", " ", GOD, 0); sprintf(temp, "%d", START_QUOTA); (void) atr_add(player, "RQUOTA", temp, GOD, 0); Index: src/game.c =================================================================== --- src/game.c (.../p6) (revision 1115) +++ src/game.c (.../p7) (revision 1115) @@ -338,6 +338,8 @@ do_rawlog(LT_ERR, T("ERROR! Database save failed.")); flag_broadcast("WIZARD ROYALTY", 0, T("GAME: ERROR! Database save failed!")); + if (f) + db_close(f); #ifndef PROFILING #ifdef HAS_ITIMER install_sig_handler(SIGPROF, signal_cpu_limit); @@ -521,8 +523,8 @@ epoch++; do_rawlog(LT_ERR, "DUMPING: %s.#%d#", globals.dumpfile, epoch); - dump_database_internal(); - do_rawlog(LT_ERR, "DUMPING: %s.#%d# (done)", globals.dumpfile, epoch); + if (!dump_database_internal()) + do_rawlog(LT_ERR, "DUMPING: %s.#%d# (done)", globals.dumpfile, epoch); } /** Dump a database, possibly by forking the process. @@ -615,7 +617,7 @@ _exit(status); /* !!! */ } else { reserve_fd(); - if (DUMP_NOFORK_COMPLETE && *DUMP_NOFORK_COMPLETE) + if (!status && DUMP_NOFORK_COMPLETE && *DUMP_NOFORK_COMPLETE) flag_broadcast(0, 0, "%s", DUMP_NOFORK_COMPLETE); } } Index: game/txt/hlp/pennfunc.hlp =================================================================== --- game/txt/hlp/pennfunc.hlp (.../p6) (revision 1115) +++ game/txt/hlp/pennfunc.hlp (.../p7) (revision 1115) @@ -1169,11 +1169,13 @@ eval(, ) get_eval(/) - Eval() works the same way as xget(), except that it performs %-substitutions - and function evaluation on the attribute before returning the value. eval() - does not modify the stack (%0-%9), so the attribute being evaled sees the - same values for them that the calling code does. Unless you need this behavior, - it is better to use u() instead, which hides the caller's stack. + Eval() works the same way as xget(), except that it performs + %-substitutions and function evaluation on the attribute before + returning the value. eval() changes the enactor (%#) to the object + executing the eval (%!). It does not modify the stack (%0-%9), so + the attribute being evaled sees the same values for them that the + calling code does. Unless you need this behavior, it is better to + use u() instead, which hides the caller's stack. Example: &TEST me=%B%B%B-[name(me)] @@ -2718,15 +2720,6 @@ object is @created (or @dug, or @opened, or @pcreated, etc.), it will have this dbref. -& NMWHO() - nmwho() - - This returns a count of all currently connected, non-hidden players. - It's exactly the same as nwho() used by a mortal, and is suitable - for use on privileged global objects who need an unprivileged count - of who's online. - -See also: nwho(), mwho(), xmwho() & NOR() nor([, ... , ]) @@ -2795,13 +2788,25 @@ nvthings() is identical to words(lvthings()) See also: ncon(), nexits(), xthings(), lthings(), lvthings() +& NMWHO() & NWHO() nwho() + nwho() + nmwho() - This returns a count of all currently-connected players. When + nwho() returns a count of all currently-connected players. When mortals use this function, DARK wizards or royalty are NOT counted. -See also: lwho(), nmwho(), xwho() + nmwho() returns a count of all currently connected, non-hidden players. + It's exactly the same as nwho() used by a mortal, and is suitable + for use on privileged global objects that always need an unprivileged + count of who is online. + + If nwho() is given an argument, and is used by an object that can see + DARK and Hidden players, nwho() returns the count of online players + based on what can see. + +See also: lwho(), mwho(), xwho(), xmwho() & OBJ() obj() Index: game/txt/hlp/pennv182.hlp =================================================================== --- game/txt/hlp/pennv182.hlp (.../p6) (revision 1115) +++ game/txt/hlp/pennv182.hlp (.../p7) (revision 1115) @@ -1,4 +1,4 @@ -& 1.8.2p6 +& 1.8.2p7 & 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,6 +11,26 @@ A list of the patchlevels associated with each release can be read in 'help patchlevels'. +Version 1.8.2 patchlevel 7 October 6, 2007 + +Minor changes: + * nwho() now takes an optional viewer argument like lwho(). By Sketch. + +Fixes: + * Clarified the behavior of eval() and get_eval() in help. Suggested by + Talvo and Javelin. + * A failed db save no longer broadcasts a success message in addition to a + failure one. Reported by Cooee. + * The open database file wasn't getting closed on a failed save. + * Crash bug in sortkey(). Fix by Nathan Baum. + * 'help @desc' brings up @describe instead of @descformat. + Suggested by Nymeria. + * Removed mention of Win32 requiring a particular attribute + compression algorithm. Any will work, and always have. + Reported by Andrew Klein. + * Crash bug in @purge. Javelin. + +& 1.8.2p6 Version 1.8.2 patchlevel 6 July 9, 2007 Development team changes: @@ -25,6 +45,8 @@ Fixes: * Fixed assorted small memory leaks. [SW] + * Fix to fraction() when dealing with numbers that can't + be fractioned. Discovered by Ashen-Shugar. [GM] * Fixed handling of telnet NOPs sent by clients. [SW] * The OpenSSL random number pool wasn't getting adequately initialized on systems without /dev/urandom [SW] Index: game/txt/hlp/penncmd.hlp =================================================================== --- game/txt/hlp/penncmd.hlp (.../p6) (revision 1115) +++ game/txt/hlp/penncmd.hlp (.../p7) (revision 1115) @@ -920,6 +920,7 @@ See also: CLIENTS, ATTRIBUTES, WILDCARDS, MUSHCODE & @describe +& @desc @describe [=] This command sets the description of the object, which will be seen Index: game/txt/hlp/pennvOLD.hlp =================================================================== --- game/txt/hlp/pennvOLD.hlp (.../p6) (revision 1115) +++ game/txt/hlp/pennvOLD.hlp (.../p7) (revision 1115) @@ -4417,7 +4417,7 @@ For information on a specific patchlevel of one of the versions listed, type 'help p'. For example, 'help 1.7.2p3' -1.8.2: 0, 1, 2, 3, 4, 5, 6 +1.8.2: 0, 1, 2, 3, 4, 5, 6, 7 1.8.1: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 1.8.0: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 1.7.7: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, Index: CHANGES.182 =================================================================== --- CHANGES.182 (.../p6) (revision 1115) +++ CHANGES.182 (.../p7) (revision 1115) @@ -13,6 +13,25 @@ ========================================================================== +Version 1.8.2 patchlevel 7 October 6, 2007 + +Minor changes: + * nwho() now takes an optional viewer argument like lwho(). By Sketch. + +Fixes: + * Clarified the behavior of eval() and get_eval() in help. Suggested by + Talvo and Javelin. + * A failed db save no longer broadcasts a success message in addition to a + failure one. Reported by Cooee. + * The open database file wasn't getting closed on a failed save. + * Crash bug in sortkey(). Fix by Nathan Baum. + * 'help @desc' brings up @describe instead of @descformat. + Suggested by Nymeria. + * Removed mention of Win32 requiring a particular attribute + compression algorithm. Any will work, and always have. + Reported by Andrew Klein. + * Crash bug in @purge. Javelin. + Version 1.8.2 patchlevel 6 July 9, 2007 Development team changes: @@ -27,6 +46,8 @@ Fixes: * Fixed assorted small memory leaks. [SW] + * Fix to fraction() when dealing with numbers that can't + be fractioned. Discovered by Ashen-Shugar. [GM] * Fixed handling of telnet NOPs sent by clients. [SW] * The OpenSSL random number pool wasn't getting adequately initialized on systems without /dev/urandom [SW] Index: hdrs/version.h =================================================================== --- hdrs/version.h (.../p6) (revision 1115) +++ hdrs/version.h (.../p7) (revision 1115) @@ -1,4 +1,4 @@ #define VERSION "1.8.2" -#define PATCHLEVEL "6" -#define PATCHDATE "[07/09/2007]" -#define NUMVERSION 1008002006 +#define PATCHLEVEL "7" +#define PATCHDATE "[10/06/2007]" +#define NUMVERSION 1008002007