This is patch25 to PennMUSH 1.7.7. After applying this patch, you will have version 1.7.7p25 To apply this patch, save it to a file in your top-level MUSH directory, and do the following: patch -p1 < 1.7.7-patch25 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: * Crash bug in the interaction between parents and attr trees fixed. Report by Walker@M*U*S*H. * Improvements to how locks are decompiled. Built-in locks with the no_inherit flag cleared are handled better. If the object doing the @decompile is referenced in a lock key, it's decompiled as 'me' rather than by dbref, to make it easier to port between games. Report by Cerekk@bDv. [SW] * The error typically logged by info_slave on a mush crash is worded better. [SW] * panic() renamed mush_panic() as the Mach kernel now has a public system call panic(). Report by Jeff Ferrell. Prereq: 1.7.7p24 *** 1_7_7.706/Patchlevel Sun, 19 Oct 2003 10:39:36 -0500 dunemush (pennmush/5_Patchlevel 1.17.1.11.1.26 600) --- 1_7_7.711(w)/Patchlevel Thu, 30 Oct 2003 09:59:37 -0600 dunemush (pennmush/5_Patchlevel 1.17.1.11.1.27 600) *************** *** 1,2 **** Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.7.7p24 --- 1,2 ---- Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.7.7p25 *** 1_7_7.706/CHANGES.177 Mon, 20 Oct 2003 21:29:07 -0500 dunemush (pennmush/g/23_CHANGES 1.48.1.208 600) --- 1_7_7.711(w)/CHANGES.177 Thu, 30 Oct 2003 09:59:22 -0600 dunemush (pennmush/g/23_CHANGES 1.48.1.211 600) *************** *** 18,23 **** --- 18,39 ---- ========================================================================== + Version 1.7.7 patchlevel 25 October 30, 2003 + + Fixes: + * Crash bug in the interaction between parents and attr trees + fixed. Report by Walker@M*U*S*H. + * Improvements to how locks are decompiled. Built-in locks with the + no_inherit flag cleared are handled better. If the object doing + the @decompile is referenced in a lock key, it's decompiled as 'me' + rather than by dbref, to make it easier to port between games. + Report by Cerekk@bDv. [SW] + * The error typically logged by info_slave on a mush crash is worded + better. [SW] + * panic() renamed mush_panic() as the Mach kernel now has a public + system call panic(). Report by Jeff Ferrell. + + Version 1.7.7 patchlevel 24 October 19, 2003 Minor Changes: *** 1_7_7.706/game/txt/hlp/penncmd.hlp Sun, 19 Oct 2003 09:57:03 -0500 dunemush (pennmush/18_penncmd.hl 1.2.1.1.1.47.1.1.1.1.1.3.1.4.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2.1.10.1.1.1.1.1.1.1.1.1.1.1.4 600) --- 1_7_7.711(w)/game/txt/hlp/penncmd.hlp Thu, 23 Oct 2003 13:05:05 -0500 dunemush (pennmush/18_penncmd.hl 1.2.1.1.1.47.1.1.1.1.1.3.1.4.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.2.1.10.1.1.1.1.1.1.1.1.1.1.1.5 600) *************** *** 320,326 **** @apayment = Sets the actions to be taken after a player gives an object some ! amount of pennies. See also: give, @pay, @opay, @cost, MONEY, ACTION LISTS & @atport --- 320,326 ---- @apayment = Sets the actions to be taken after a player gives an object some ! amount of pennies. The amount paid is passed in as %0. See also: give, @pay, @opay, @cost, MONEY, ACTION LISTS & @atport *** 1_7_7.706/src/wiz.c Mon, 20 Oct 2003 21:29:07 -0500 dunemush (pennmush/b/23_wiz.c 1.44.1.1.1.1.1.2.1.7.1.1.1.1.1.1.1.1.1.1.1.8.1.2.2.2.1.2.1.1.1.1.1.1.1.2.1.1.1.2.2.17.1.6 660) --- 1_7_7.711(w)/src/wiz.c Thu, 30 Oct 2003 10:06:42 -0600 dunemush (pennmush/b/23_wiz.c 1.44.1.1.1.1.1.2.1.7.1.1.1.1.1.1.1.1.1.1.1.8.1.2.2.2.1.2.1.1.1.1.1.1.1.2.1.1.1.2.2.17.1.7 660) *************** *** 1493,1499 **** *result = (dbref *) mush_malloc(sizeof(dbref) * result_size, "search_results"); if (!*result) ! panic(T("Couldn't allocate memory in search!")); switch (sclass) { case S_OWNER: /* @search someone */ --- 1493,1499 ---- *result = (dbref *) mush_malloc(sizeof(dbref) * result_size, "search_results"); if (!*result) ! mush_panic(T("Couldn't allocate memory in search!")); switch (sclass) { case S_OWNER: /* @search someone */ *************** *** 1507,1513 **** newresults = (dbref *) realloc((Malloc_t) *result, sizeof(dbref) * result_size); if (!newresults) ! panic(T("Couldn't reallocate memory in search!")); *result = newresults; } (*result)[nresults++] = (dbref) n; --- 1507,1513 ---- newresults = (dbref *) realloc((Malloc_t) *result, sizeof(dbref) * result_size); if (!newresults) ! mush_panic(T("Couldn't reallocate memory in search!")); *result = newresults; } (*result)[nresults++] = (dbref) n; *************** *** 1524,1530 **** newresults = (dbref *) realloc((Malloc_t) *result, sizeof(dbref) * result_size); if (!newresults) ! panic(T("Couldn't reallocate memory in search!")); *result = newresults; } --- 1524,1530 ---- newresults = (dbref *) realloc((Malloc_t) *result, sizeof(dbref) * result_size); if (!newresults) ! mush_panic(T("Couldn't reallocate memory in search!")); *result = newresults; } *************** *** 1542,1548 **** newresults = (dbref *) realloc((Malloc_t) *result, sizeof(dbref) * result_size); if (!newresults) ! panic(T("Couldn't reallocate memory in search!")); *result = newresults; } --- 1542,1548 ---- newresults = (dbref *) realloc((Malloc_t) *result, sizeof(dbref) * result_size); if (!newresults) ! mush_panic(T("Couldn't reallocate memory in search!")); *result = newresults; } *************** *** 1561,1567 **** newresults = (dbref *) realloc((Malloc_t) *result, sizeof(dbref) * result_size); if (!newresults) ! panic(T("Couldn't reallocate memory in search!")); *result = newresults; } --- 1561,1567 ---- newresults = (dbref *) realloc((Malloc_t) *result, sizeof(dbref) * result_size); if (!newresults) ! mush_panic(T("Couldn't reallocate memory in search!")); *result = newresults; } *************** *** 1600,1606 **** newresults = (dbref *) realloc((Malloc_t) *result, sizeof(dbref) * result_size); if (!newresults) ! panic(T("Couldn't reallocate memory in search!")); *result = newresults; } (*result)[nresults++] = (dbref) n; --- 1600,1606 ---- newresults = (dbref *) realloc((Malloc_t) *result, sizeof(dbref) * result_size); if (!newresults) ! mush_panic(T("Couldn't reallocate memory in search!")); *result = newresults; } (*result)[nresults++] = (dbref) n; *************** *** 1619,1625 **** newresults = (dbref *) realloc((Malloc_t) *result, sizeof(dbref) * result_size); if (!newresults) ! panic(T("Couldn't reallocate memory in search!")); *result = newresults; } --- 1619,1625 ---- newresults = (dbref *) realloc((Malloc_t) *result, sizeof(dbref) * result_size); if (!newresults) ! mush_panic(T("Couldn't reallocate memory in search!")); *result = newresults; } *************** *** 1641,1647 **** newresults = (dbref *) realloc((Malloc_t) *result, sizeof(dbref) * result_size); if (!newresults) ! panic(T("Couldn't reallocate memory in search!")); *result = newresults; } --- 1641,1647 ---- newresults = (dbref *) realloc((Malloc_t) *result, sizeof(dbref) * result_size); if (!newresults) ! mush_panic(T("Couldn't reallocate memory in search!")); *result = newresults; } *** 1_7_7.706/src/unparse.c Mon, 28 Apr 2003 22:37:00 -0500 dunemush (pennmush/b/28_unparse.c 1.16.1.7.1.9 660) --- 1_7_7.711(w)/src/unparse.c Thu, 30 Oct 2003 10:06:42 -0600 dunemush (pennmush/b/28_unparse.c 1.16.1.7.1.10 660) *************** *** 199,205 **** if (a) { arg = (char *) mush_malloc(BUFFER_LEN, "string"); if (!arg) ! panic("Unable to allocate memory in nameformat"); save_global_regs("nameformat", rsave); for (j = 0; j < 10; j++) { wsave[j] = wenv[j]; --- 199,205 ---- if (a) { arg = (char *) mush_malloc(BUFFER_LEN, "string"); if (!arg) ! mush_panic("Unable to allocate memory in nameformat"); save_global_regs("nameformat", rsave); for (j = 0; j < 10; j++) { wsave[j] = wenv[j]; *** 1_7_7.706/src/timer.c Wed, 20 Aug 2003 16:35:51 -0500 dunemush (pennmush/b/29_timer.c 1.29.1.7.1.13 660) --- 1_7_7.711(w)/src/timer.c Thu, 30 Oct 2003 10:06:42 -0600 dunemush (pennmush/b/29_timer.c 1.29.1.7.1.14 660) *************** *** 160,166 **** "migration reference array"); refs_size = actual; if (!refs) ! panic("Could not allocate migration reference array"); } #ifdef DEBUG_MIGRATE do_rawlog(LT_TRACE, "Migrate asked %d, actual objects #%d to #%d for %d", --- 160,166 ---- "migration reference array"); refs_size = actual; if (!refs) ! mush_panic("Could not allocate migration reference array"); } #ifdef DEBUG_MIGRATE do_rawlog(LT_TRACE, "Migrate asked %d, actual objects #%d to #%d for %d", *** 1_7_7.706/src/help.c Sat, 20 Sep 2003 10:19:14 -0500 dunemush (pennmush/f/32_help.c 1.4.1.2.1.1.1.3.2.2.1.1.2.1.1.2.1.2.1.2.1.3.1.17 660) --- 1_7_7.711(w)/src/help.c Thu, 30 Oct 2003 10:06:40 -0600 dunemush (pennmush/f/32_help.c 1.4.1.2.1.1.1.3.2.2.1.1.2.1.1.2.1.2.1.2.1.3.1.18 660) *************** *** 318,324 **** else topics = (help_indx *) malloc(top_topics * sizeof(help_indx)); if (!topics) { ! panic(T("Out of memory")); } } temp = &topics[num_topics++]; --- 318,324 ---- else topics = (help_indx *) malloc(top_topics * sizeof(help_indx)); if (!topics) { ! mush_panic(T("Out of memory")); } } temp = &topics[num_topics++]; *** 1_7_7.706/src/strutil.c Tue, 07 Oct 2003 00:14:21 -0500 dunemush (pennmush/b/33_strutil.c 1.28.1.3.1.3.1.7.2.1.1.2.1.1.1.1.1.1.1.21.1.2.1.2.1.7 660) --- 1_7_7.711(w)/src/strutil.c Thu, 30 Oct 2003 10:06:42 -0600 dunemush (pennmush/b/33_strutil.c 1.28.1.3.1.3.1.7.2.1.1.2.1.1.1.1.1.1.1.21.1.2.1.2.1.8 660) *************** *** 867,873 **** r = result = mush_malloc(BUFFER_LEN, "replace_string.buff"); if (!result) ! panic(T("Couldn't allocate memory in replace_string!")); len = strlen(old); newlen = strlen(newbit); --- 867,873 ---- r = result = mush_malloc(BUFFER_LEN, "replace_string.buff"); if (!result) ! mush_panic(T("Couldn't allocate memory in replace_string!")); len = strlen(old); newlen = strlen(newbit); *************** *** 914,920 **** 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]; --- 914,920 ---- rp = result = mush_malloc(BUFFER_LEN, "replace_string.buff"); if (!result) ! mush_panic(T("Couldn't allocate memory in replace_string2!")); firsts[0] = old[0][0]; firsts[1] = old[1][0]; *** 1_7_7.706/src/speech.c Mon, 01 Sep 2003 15:52:02 -0500 dunemush (pennmush/b/35_speech.c 1.21.1.2.1.3.1.5.1.1.1.7.1.3.1.1.1.8.1.1.1.1.1.1.1.10.1.2.1.13.2.4.1.1.3.1.1.5.1.1 660) --- 1_7_7.711(w)/src/speech.c Thu, 30 Oct 2003 10:06:42 -0600 dunemush (pennmush/b/35_speech.c 1.21.1.2.1.3.1.5.1.1.1.7.1.3.1.1.1.8.1.1.1.1.1.1.1.10.1.2.1.13.2.4.1.1.3.1.1.5.1.1.1.1 660) *************** *** 360,366 **** } tp = tbuf = (char *) mush_malloc(BUFFER_LEN, "string"); if (!tbuf) ! panic("Unable to allocate memory in do_whisper_list"); overheard = 0; head = arg1; --- 360,366 ---- } tp = tbuf = (char *) mush_malloc(BUFFER_LEN, "string"); if (!tbuf) ! mush_panic("Unable to allocate memory in do_whisper_list"); overheard = 0; head = arg1; *************** *** 721,727 **** tp2 = tbuf2 = (char *) mush_malloc(BUFFER_LEN, "string"); if (!tbuf2) ! panic("Unable to allocate memory in do_page"); if (arg2 && *arg2 && *arg1) { /* page to=msg. Always evaluate to, maybe evaluate msg */ --- 721,727 ---- tp2 = tbuf2 = (char *) mush_malloc(BUFFER_LEN, "string"); if (!tbuf2) ! mush_panic("Unable to allocate memory in do_page"); if (arg2 && *arg2 && *arg1) { /* page to=msg. Always evaluate to, maybe evaluate msg */ *************** *** 757,763 **** tp = tbuf = (char *) mush_malloc(BUFFER_LEN, "string"); if (!tbuf) ! panic("Unable to allocate memory in do_page"); if (override && !Pemit_All(player)) { notify(player, "Try again after you get the pemit_all power."); --- 757,763 ---- tp = tbuf = (char *) mush_malloc(BUFFER_LEN, "string"); if (!tbuf) ! mush_panic("Unable to allocate memory in do_page"); if (override && !Pemit_All(player)) { notify(player, "Try again after you get the pemit_all power."); *************** *** 863,869 **** else { mb = msgbuf = (char *) mush_malloc(BUFFER_LEN, "string"); if (!msgbuf) ! panic("Unable to allocate memory in do_page"); process_expression(msgbuf, &mb, &message, player, cause, cause, PE_DEFAULT, PT_DEFAULT, NULL); --- 863,869 ---- else { mb = msgbuf = (char *) mush_malloc(BUFFER_LEN, "string"); if (!msgbuf) ! mush_panic("Unable to allocate memory in do_page"); process_expression(msgbuf, &mb, &message, player, cause, cause, PE_DEFAULT, PT_DEFAULT, NULL); *** 1_7_7.706/src/services.c Sun, 01 Dec 2002 21:14:41 -0600 dunemush (pennmush/b/39_services.c 1.14 660) --- 1_7_7.711(w)/src/services.c Thu, 30 Oct 2003 10:06:42 -0600 dunemush (pennmush/b/39_services.c 1.15 660) *************** *** 361,367 **** TerminateThread(threadHandle, 1); threadHandle = NULL; ! panic(T("System shutdown by system operator")); _exit(99); --- 361,367 ---- TerminateThread(threadHandle, 1); threadHandle = NULL; ! mush_panic(T("System shutdown by system operator")); _exit(99); *** 1_7_7.706/src/look.c Tue, 30 Sep 2003 16:39:26 -0500 dunemush (pennmush/c/4_look.c 1.21.1.2.1.9.1.1.1.1.1.18 660) --- 1_7_7.711(w)/src/look.c Thu, 30 Oct 2003 10:06:41 -0600 dunemush (pennmush/c/4_look.c 1.21.1.2.1.9.1.1.1.1.1.19 660) *************** *** 74,80 **** tbuf2 = (char *) mush_malloc(BUFFER_LEN, "string"); nbuf = (char *) mush_malloc(BUFFER_LEN, "string"); if (!tbuf1 || !tbuf2 || !nbuf) ! panic("Unable to allocate memory in look_exits"); s1 = tbuf1; s2 = tbuf2; texits = exit_count = total_count = 0; --- 74,80 ---- tbuf2 = (char *) mush_malloc(BUFFER_LEN, "string"); nbuf = (char *) mush_malloc(BUFFER_LEN, "string"); if (!tbuf1 || !tbuf2 || !nbuf) ! mush_panic("Unable to allocate memory in look_exits"); s1 = tbuf1; s2 = tbuf2; texits = exit_count = total_count = 0; *************** *** 90,96 **** arg = (char *) mush_malloc(BUFFER_LEN, "string"); buff = (char *) mush_malloc(BUFFER_LEN, "string"); if (!arg || !buff) ! panic("Unable to allocate memory in look_exits"); save_global_regs("look_exits", rsave); for (j = 0; j < 10; j++) { wsave[j] = wenv[j]; --- 90,96 ---- arg = (char *) mush_malloc(BUFFER_LEN, "string"); buff = (char *) mush_malloc(BUFFER_LEN, "string"); if (!arg || !buff) ! mush_panic("Unable to allocate memory in look_exits"); save_global_regs("look_exits", rsave); for (j = 0; j < 10; j++) { wsave[j] = wenv[j]; *************** *** 241,247 **** arg = (char *) mush_malloc(BUFFER_LEN, "string"); buff = (char *) mush_malloc(BUFFER_LEN, "string"); if (!arg || !buff) ! panic("Unable to allocate memory in look_contents"); save_global_regs("look_contents", rsave); for (j = 0; j < 10; j++) { wsave[j] = wenv[j]; --- 241,247 ---- arg = (char *) mush_malloc(BUFFER_LEN, "string"); buff = (char *) mush_malloc(BUFFER_LEN, "string"); if (!arg || !buff) ! mush_panic("Unable to allocate memory in look_contents"); save_global_regs("look_contents", rsave); for (j = 0; j < 10; j++) { wsave[j] = wenv[j]; *************** *** 1346,1371 **** { lock_list *ll; for (ll = Locks(thing); ll; ll = ll->next) { ! if (match_lock(ll->type) != NULL) { notify_format(player, "@lock/%s %s=%s", L_TYPE(ll), name, unparse_boolexp(player, L_KEY(ll), ! UB_DBREF)); ! if (L_FLAGS(ll)) { ! if (skipdef) { ! const lock_list *p = get_lockproto(L_TYPE(ll)); ! if (p && L_FLAGS(ll) == L_FLAGS(p)) ! continue; ! } notify_format(player, "@lset %s/%s=%s", name, L_TYPE(ll), lock_flags_long(ll)); ! } } else { notify_format(player, "@lock/user:%s %s=%s", ! ll->type, name, unparse_boolexp(player, ll->key, UB_DBREF)); if (L_FLAGS(ll)) notify_format(player, "@lset %s/%s=%s", name, L_TYPE(ll), lock_flags_long(ll)); - } } } --- 1346,1371 ---- { lock_list *ll; for (ll = Locks(thing); ll; ll = ll->next) { ! const lock_list *p = get_lockproto(L_TYPE(ll)); ! if (p) { notify_format(player, "@lock/%s %s=%s", L_TYPE(ll), name, unparse_boolexp(player, L_KEY(ll), ! UB_MEREF)); ! if (skipdef) { ! if (p && L_FLAGS(ll) == L_FLAGS(p)) ! continue; ! } ! if (L_FLAGS(ll)) notify_format(player, "@lset %s/%s=%s", name, L_TYPE(ll), lock_flags_long(ll)); ! if ((L_FLAGS(p) & LF_PRIVATE) && !(L_FLAGS(ll) & LF_PRIVATE)) ! notify_format(player, "@lset %s/%s=!no_inherit", name, L_TYPE(ll)); } else { notify_format(player, "@lock/user:%s %s=%s", ! ll->type, name, unparse_boolexp(player, ll->key, UB_MEREF)); if (L_FLAGS(ll)) notify_format(player, "@lset %s/%s=%s", name, L_TYPE(ll), lock_flags_long(ll)); } } } *** 1_7_7.706/src/lock.c Tue, 23 Sep 2003 11:13:02 -0500 dunemush (pennmush/c/6_lock.c 1.17.1.13.1.1.1.1.1.11 660) --- 1_7_7.711(w)/src/lock.c Thu, 30 Oct 2003 10:06:40 -0600 dunemush (pennmush/c/6_lock.c 1.17.1.13.1.1.1.1.1.12 660) *************** *** 222,228 **** ll = mush_malloc(sizeof(lock_list) * LOCKS_PER_PAGE, "lock_page"); if (!ll) ! panic("Unable to allocate memory for locks!"); for (n = 0; n < LOCKS_PER_PAGE - 1; n++) { ll[n].type = NULL; --- 222,228 ---- ll = mush_malloc(sizeof(lock_list) * LOCKS_PER_PAGE, "lock_page"); if (!ll) ! mush_panic("Unable to allocate memory for locks!"); for (n = 0; n < LOCKS_PER_PAGE - 1; n++) { ll[n].type = NULL; *************** *** 359,365 **** const lock_list *ll; for (ll = lock_types; ll->type; ll++) ! if (strcmp(type, ll->type) == 0) return ll; return NULL; --- 359,365 ---- const lock_list *ll; for (ll = lock_types; ll->type; ll++) ! if (strcasecmp(type, ll->type) == 0) return ll; return NULL; *** 1_7_7.706/src/info_slave.c Mon, 14 Jul 2003 09:07:25 -0500 dunemush (pennmush/c/7_info_slave 1.9.1.4.1.6 660) --- 1_7_7.711(w)/src/info_slave.c Thu, 30 Oct 2003 10:06:40 -0600 dunemush (pennmush/c/7_info_slave 1.9.1.4.1.7 660) *************** *** 148,154 **** len = read(mush, &rlen, sizeof rlen); if (len < (int) sizeof rlen) { ! perror("info_slave reading remote size"); return EXIT_FAILURE; } /* Now the first address and len of the second. */ --- 148,154 ---- len = read(mush, &rlen, sizeof rlen); if (len < (int) sizeof rlen) { ! perror("info_slave reading remote size (Did the mush crash?)"); return EXIT_FAILURE; } /* Now the first address and len of the second. */ *** 1_7_7.706/src/game.c Mon, 06 Oct 2003 23:31:57 -0500 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.2.1.1.1.1.1.1.1.2.1.1.1.2.1.1.1.1.1.1.1.1.1.5.1.3.1.2.1.2.1.1.1.1.1.1.1.1.1.12.1.3.1.3 660) --- 1_7_7.711(w)/src/game.c Thu, 30 Oct 2003 10:06:40 -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.2.1.1.1.1.1.1.1.2.1.1.1.2.1.1.1.1.1.1.1.1.1.5.1.3.1.2.1.2.1.1.1.1.1.1.1.1.1.12.1.3.1.4 660) *************** *** 310,316 **** #endif if (flag == SHUT_PANIC) { ! panic("@shutdown/panic"); } else { if (flag == SHUT_PARANOID) { paranoid_checkpt = db_top / 5; --- 310,316 ---- #endif if (flag == SHUT_PANIC) { ! mush_panic("@shutdown/panic"); } else { if (flag == SHUT_PARANOID) { paranoid_checkpt = db_top / 5; *************** *** 456,462 **** * \param message message to log to the error log. */ void ! panic(const char *message) { const char *panicfile = options.crash_db; FILE *f = NULL; --- 456,462 ---- * \param message message to log to the error log. */ void ! mush_panic(const char *message) { const char *panicfile = options.crash_db; FILE *f = NULL; *** 1_7_7.706/src/funlist.c Thu, 11 Sep 2003 15:26:04 -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.2 660) --- 1_7_7.711(w)/src/funlist.c Thu, 30 Oct 2003 10:06:39 -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.3.1.2.1.1.1.1.1.1.1.1.1.1.1.12.1.14.1.3 660) *************** *** 172,178 **** ptrs1 = (char **) mush_malloc(MAX_SORTSIZE * sizeof(char *), "ptrarray"); ptrs2 = (char **) mush_malloc(MAX_SORTSIZE * sizeof(char *), "ptrarray"); if (!ptrs1 || !ptrs2) ! panic("Unable to allocate memory in fun_munge"); nptrs1 = list2arr(ptrs1, MAX_SORTSIZE, args[1], sep); nptrs2 = list2arr(ptrs2, MAX_SORTSIZE, args[2], sep); --- 172,178 ---- ptrs1 = (char **) mush_malloc(MAX_SORTSIZE * sizeof(char *), "ptrarray"); ptrs2 = (char **) mush_malloc(MAX_SORTSIZE * sizeof(char *), "ptrarray"); if (!ptrs1 || !ptrs2) ! mush_panic("Unable to allocate memory in fun_munge"); nptrs1 = list2arr(ptrs1, MAX_SORTSIZE, args[1], sep); nptrs2 = list2arr(ptrs2, MAX_SORTSIZE, args[2], sep); *************** *** 199,205 **** */ results = (char **) mush_malloc(MAX_SORTSIZE * sizeof(char *), "ptrarray"); if (!results) ! panic("Unable to allocate memory in fun_munge"); nresults = list2arr(results, MAX_SORTSIZE, rlist, sep); first = 1; --- 199,205 ---- */ results = (char **) mush_malloc(MAX_SORTSIZE * sizeof(char *), "ptrarray"); if (!results) ! mush_panic("Unable to allocate memory in fun_munge"); nresults = list2arr(results, MAX_SORTSIZE, rlist, sep); first = 1; *************** *** 248,254 **** ptrs = (char **) mush_malloc(MAX_SORTSIZE * sizeof(char *), "ptrarray"); wordlist = (char *) mush_malloc(BUFFER_LEN, "string"); if (!ptrs || !wordlist) ! panic("Unable to allocate memory in fun_elements"); /* Turn the first list into an array. */ strcpy(wordlist, args[0]); --- 248,254 ---- ptrs = (char **) mush_malloc(MAX_SORTSIZE * sizeof(char *), "ptrarray"); wordlist = (char *) mush_malloc(BUFFER_LEN, "string"); if (!ptrs || !wordlist) ! mush_panic("Unable to allocate memory in fun_elements"); /* Turn the first list into an array. */ strcpy(wordlist, args[0]); *************** *** 381,387 **** result = (char *) mush_malloc(BUFFER_LEN, "string"); rsave = (char *) mush_malloc(BUFFER_LEN, "string"); if (!result || !rsave) ! panic("Unable to allocate memory in fun_fold"); abuf = safe_atr_value(attrib); --- 381,387 ---- result = (char *) mush_malloc(BUFFER_LEN, "string"); rsave = (char *) mush_malloc(BUFFER_LEN, "string"); if (!result || !rsave) ! mush_panic("Unable to allocate memory in fun_fold"); abuf = safe_atr_value(attrib); *************** *** 1090,1096 **** 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]) memcpy(tempbuff, args[1], arglens[1] + 1); --- 1090,1096 ---- a1 = (char **) mush_malloc(MAX_SORTSIZE * sizeof(char *), "ptrarray"); a2 = (char **) mush_malloc(MAX_SORTSIZE * sizeof(char *), "ptrarray"); if (!tempbuff || !a1 || !a2) ! mush_panic("Unable to allocate memory in fun_setunion"); /* Concat both lists, make array, sort */ if (!*args[0]) memcpy(tempbuff, args[1], arglens[1] + 1); *************** *** 1155,1161 **** a1 = (char **) mush_malloc(MAX_SORTSIZE * sizeof(char *), "ptrarray"); a2 = (char **) mush_malloc(MAX_SORTSIZE * sizeof(char *), "ptrarray"); if (!a1 || !a2) ! panic("Unable to allocate memory in fun_setunion"); /* make arrays out of the lists */ n1 = list2arr(a1, MAX_SORTSIZE, args[0], sep); --- 1155,1161 ---- a1 = (char **) mush_malloc(MAX_SORTSIZE * sizeof(char *), "ptrarray"); a2 = (char **) mush_malloc(MAX_SORTSIZE * sizeof(char *), "ptrarray"); if (!a1 || !a2) ! mush_panic("Unable to allocate memory in fun_setunion"); /* make arrays out of the lists */ n1 = list2arr(a1, MAX_SORTSIZE, args[0], sep); *************** *** 1270,1276 **** a1 = (char **) mush_malloc(MAX_SORTSIZE * sizeof(char *), "ptrarray"); a2 = (char **) mush_malloc(MAX_SORTSIZE * sizeof(char *), "ptrarray"); if (!a1 || !a2) ! panic("Unable to allocate memory in fun_setunion"); /* make arrays out of the lists */ n1 = list2arr(a1, MAX_SORTSIZE, args[0], sep); --- 1270,1276 ---- a1 = (char **) mush_malloc(MAX_SORTSIZE * sizeof(char *), "ptrarray"); a2 = (char **) mush_malloc(MAX_SORTSIZE * sizeof(char *), "ptrarray"); if (!a1 || !a2) ! mush_panic("Unable to allocate memory in fun_setunion"); /* make arrays out of the lists */ n1 = list2arr(a1, MAX_SORTSIZE, args[0], sep); *************** *** 2148,2154 **** outsep = (char *) mush_malloc(BUFFER_LEN, "string"); list = (char *) mush_malloc(BUFFER_LEN, "string"); if (!outsep || !list) ! panic("Unable to allocate memory in fun_iter"); if (nargs < 4) strcpy(outsep, " "); else { --- 2148,2154 ---- outsep = (char *) mush_malloc(BUFFER_LEN, "string"); list = (char *) mush_malloc(BUFFER_LEN, "string"); if (!outsep || !list) ! mush_panic("Unable to allocate memory in fun_iter"); if (nargs < 4) strcpy(outsep, " "); else { *** 1_7_7.706/src/flags.c Sat, 11 Oct 2003 12:37:44 -0500 dunemush (pennmush/c/20_flags.c 1.1.1.1.1.1.1.1.1.1.1.1.1.6.1.2.1.1.1.1.1.2.2.2.2.1.2.1.1.3.1.2.1.1.1.1.1.1.1.1.1.3.1.9.1.2.2.1.1.2.1.56.1.6 660) --- 1_7_7.711(w)/src/flags.c Thu, 30 Oct 2003 10:06:39 -0600 dunemush (pennmush/c/20_flags.c 1.1.1.1.1.1.1.1.1.1.1.1.1.6.1.2.1.1.1.1.1.2.2.2.2.1.2.1.1.3.1.2.1.1.1.1.1.1.1.1.1.3.1.9.1.2.2.1.1.2.1.56.1.7 660) *************** *** 68,74 **** extern PTAB ptab_command; /* Uses flag bitmasks */ ! #define Flagspace_Lookup(n,ns) if (!(n = (FLAGSPACE *)hashfind(ns,&htab_flagspaces))) panic("Unable to locate flagspace"); /** This is the old default flag table. We still use it when we have to * convert old dbs, but once you have a converted db, it's the flag --- 68,74 ---- extern PTAB ptab_command; /* Uses flag bitmasks */ ! #define Flagspace_Lookup(n,ns) if (!(n = (FLAGSPACE *)hashfind(ns,&htab_flagspaces))) mush_panic("Unable to locate flagspace"); /** This is the old default flag table. We still use it when we have to * convert old dbs, but once you have a converted db, it's the flag *************** *** 342,348 **** { FLAG *f = (FLAG *) mush_malloc(sizeof(FLAG), "flag"); if (!f) ! panic("Unable to allocate memory for a new flag!\n"); return f; } --- 342,348 ---- { FLAG *f = (FLAG *) mush_malloc(sizeof(FLAG), "flag"); if (!f) ! mush_panic("Unable to allocate memory for a new flag!\n"); return f; } *************** *** 410,416 **** n->flags = (FLAG **) realloc(n->flags, (f->bitpos + 1) * sizeof(FLAG *)); if (!n->flags) ! panic("Unable to reallocate flags array!\n"); } /* Make sure the new space is full of NULLs */ for (i = n->flagbits; i <= f->bitpos; i++) --- 410,416 ---- n->flags = (FLAG **) realloc(n->flags, (f->bitpos + 1) * sizeof(FLAG *)); if (!n->flags) ! mush_panic("Unable to reallocate flags array!\n"); } /* Make sure the new space is full of NULLs */ for (i = n->flagbits; i <= f->bitpos; i++) *************** *** 796,802 **** Flagspace_Lookup(n, ns); bitmask = (object_flag_type) mush_malloc(FlagBytes(n), "flag_bitmask"); if (!bitmask) ! panic("Unable to allocate memory for flag bitmask"); memset(bitmask, 0, FlagBytes(n)); return bitmask; } --- 796,802 ---- Flagspace_Lookup(n, ns); bitmask = (object_flag_type) mush_malloc(FlagBytes(n), "flag_bitmask"); if (!bitmask) ! mush_panic("Unable to allocate memory for flag bitmask"); memset(bitmask, 0, FlagBytes(n)); return bitmask; } *************** *** 816,822 **** Flagspace_Lookup(n, ns); bitmask = (object_flag_type) mush_malloc(FlagBytes(n), "flag_bitmask"); if (!bitmask) ! panic("Unable to allocate memory for flag bitmask"); memcpy(bitmask, given, FlagBytes(n)); return bitmask; } --- 816,822 ---- Flagspace_Lookup(n, ns); bitmask = (object_flag_type) mush_malloc(FlagBytes(n), "flag_bitmask"); if (!bitmask) ! mush_panic("Unable to allocate memory for flag bitmask"); memcpy(bitmask, given, FlagBytes(n)); return bitmask; } *** 1_7_7.706/src/extmail.c Sat, 05 Jul 2003 15:56:20 -0500 dunemush (pennmush/c/22_extmail.c 1.44.1.7.1.5.1.9.1.1.1.1.1.7 660) --- 1_7_7.711(w)/src/extmail.c Thu, 30 Oct 2003 10:06:39 -0600 dunemush (pennmush/c/22_extmail.c 1.44.1.7.1.5.1.9.1.1.1.1.1.8 660) *************** *** 1025,1038 **** unsigned char *text; newmsg = (char *) mush_malloc(BUFFER_LEN, "string"); if (!newmsg) ! panic(T("Failed to allocate string in send_mail")); nm = newmsg; safe_str(message, newmsg, &nm); if (!nosig && ((a = atr_get_noparent(player, "MAILSIGNATURE")) != NULL)) { /* Append the MAILSIGNATURE to the mail - Cordin@Dune's idea */ buff = (char *) mush_malloc(BUFFER_LEN, "string"); if (!buff) ! panic(T("Failed to allocate string in send_mail")); ms = mailsig = safe_atr_value(a); bp = buff; process_expression(buff, &bp, &ms, player, player, player, --- 1025,1038 ---- unsigned char *text; newmsg = (char *) mush_malloc(BUFFER_LEN, "string"); if (!newmsg) ! mush_panic(T("Failed to allocate string in send_mail")); nm = newmsg; safe_str(message, newmsg, &nm); if (!nosig && ((a = atr_get_noparent(player, "MAILSIGNATURE")) != NULL)) { /* Append the MAILSIGNATURE to the mail - Cordin@Dune's idea */ buff = (char *) mush_malloc(BUFFER_LEN, "string"); if (!buff) ! mush_panic(T("Failed to allocate string in send_mail")); ms = mailsig = safe_atr_value(a); bp = buff; process_expression(buff, &bp, &ms, player, player, player, *************** *** 2197,2203 **** str = (char *) mush_malloc(BUFFER_LEN, "string"); tbuf = (char *) mush_malloc(BUFFER_LEN, "string"); if (!new || !pat || !str || !tbuf) ! panic(T("Failed to allocate strings in add_folder_name")); if (name && *name) sprintf(new, "%d:%s:%d ", fld, strupper(name), fld); --- 2197,2203 ---- str = (char *) mush_malloc(BUFFER_LEN, "string"); tbuf = (char *) mush_malloc(BUFFER_LEN, "string"); if (!new || !pat || !str || !tbuf) ! mush_panic(T("Failed to allocate strings in add_folder_name")); if (name && *name) sprintf(new, "%d:%s:%d ", fld, strupper(name), fld); *** 1_7_7.706/src/extchat.c Thu, 09 Oct 2003 19:20:51 -0500 dunemush (pennmush/c/23_extchat.c 1.1.1.1.1.1.1.1.1.2.1.1.1.3.1.1.1.5.1.1.1.1.1.5.1.2.1.3.1.3.1.1.1.4.1.2.1.6.1.2.1.1.2.4.2.9.1.2.1.2.1.3.1.2.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.2.1.1.2.1.1.2.1.1.1.1.1.1.1.1.1.7 660) --- 1_7_7.711(w)/src/extchat.c Thu, 30 Oct 2003 10:06:39 -0600 dunemush (pennmush/c/23_extchat.c 1.1.1.1.1.1.1.1.1.2.1.1.1.3.1.1.1.5.1.1.1.1.1.5.1.2.1.3.1.3.1.1.1.4.1.2.1.6.1.2.1.1.2.4.2.9.1.2.1.2.1.3.1.2.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.2.1.1.2.1.1.2.1.1.1.1.1.1.1.1.1.8 660) *************** *** 250,256 **** CHANUSER *u; u = (CHANUSER *) mush_malloc(sizeof(CHANUSER), "CHANUSER"); if (!u) ! panic("Couldn't allocate memory in new_user in extchat.c"); CUdbref(u) = who; CUtype(u) = CU_DEFAULT_FLAGS; u->title[0] = '\0'; --- 250,256 ---- CHANUSER *u; u = (CHANUSER *) mush_malloc(sizeof(CHANUSER), "CHANUSER"); if (!u) ! mush_panic("Couldn't allocate memory in new_user in extchat.c"); CUdbref(u) = who; CUtype(u) = CU_DEFAULT_FLAGS; u->title[0] = '\0'; *************** *** 2275,2293 **** Name(ChanCreator(c))); if (ChanModLock(c) != TRUE_BOOLEXP) notify_format(player, "@clock/mod %s = %s", ChanName(c), ! unparse_boolexp(player, ChanModLock(c), UB_DBREF)); if (ChanHideLock(c) != TRUE_BOOLEXP) notify_format(player, "@clock/hide %s = %s", ChanName(c), ! unparse_boolexp(player, ChanHideLock(c), UB_DBREF)); if (ChanJoinLock(c) != TRUE_BOOLEXP) notify_format(player, "@clock/join %s = %s", ChanName(c), ! unparse_boolexp(player, ChanJoinLock(c), UB_DBREF)); if (ChanSpeakLock(c) != TRUE_BOOLEXP) notify_format(player, "@clock/speak %s = %s", ChanName(c), ! unparse_boolexp(player, ChanSpeakLock(c), UB_DBREF)); if (ChanSeeLock(c) != TRUE_BOOLEXP) notify_format(player, "@clock/see %s = %s", ChanName(c), ! unparse_boolexp(player, ChanSeeLock(c), UB_DBREF)); if (ChanTitle(c)) notify_format(player, "@channel/desc %s = %s", ChanName(c), ChanTitle(c)); --- 2275,2293 ---- Name(ChanCreator(c))); if (ChanModLock(c) != TRUE_BOOLEXP) notify_format(player, "@clock/mod %s = %s", ChanName(c), ! unparse_boolexp(player, ChanModLock(c), UB_MEREF)); if (ChanHideLock(c) != TRUE_BOOLEXP) notify_format(player, "@clock/hide %s = %s", ChanName(c), ! unparse_boolexp(player, ChanHideLock(c), UB_MEREF)); if (ChanJoinLock(c) != TRUE_BOOLEXP) notify_format(player, "@clock/join %s = %s", ChanName(c), ! unparse_boolexp(player, ChanJoinLock(c), UB_MEREF)); if (ChanSpeakLock(c) != TRUE_BOOLEXP) notify_format(player, "@clock/speak %s = %s", ChanName(c), ! unparse_boolexp(player, ChanSpeakLock(c), UB_MEREF)); if (ChanSeeLock(c) != TRUE_BOOLEXP) notify_format(player, "@clock/see %s = %s", ChanName(c), ! unparse_boolexp(player, ChanSeeLock(c), UB_MEREF)); if (ChanTitle(c)) notify_format(player, "@channel/desc %s = %s", ChanName(c), ChanTitle(c)); *** 1_7_7.706/src/comp_w.c Mon, 28 Apr 2003 00:35:06 -0500 dunemush (pennmush/c/33_comp_w.c 1.17 660) --- 1_7_7.711(w)/src/comp_w.c Thu, 30 Oct 2003 10:06:39 -0600 dunemush (pennmush/c/33_comp_w.c 1.18 660) *************** *** 210,216 **** words[i] = malloc(wordpos); if (!words[i]) ! panic("Out of memory in string compression routine"); #ifdef COMP_STATS total_mallocs += wordpos; --- 210,216 ---- words[i] = malloc(wordpos); if (!words[i]) ! mush_panic("Out of memory in string compression routine"); #ifdef COMP_STATS total_mallocs += wordpos; *************** *** 316,322 **** } else { panicking = 1; /* don't panic from within panic */ do_rawlog(LT_ERR, "Error in string decompression, i = %i", i); ! panic("Fatal error in decompression"); } } strncpy((char *) b, words[i], words_len[i]); --- 316,322 ---- } else { panicking = 1; /* don't panic from within panic */ do_rawlog(LT_ERR, "Error in string decompression, i = %i", i); ! mush_panic("Fatal error in decompression"); } } strncpy((char *) b, words[i], words_len[i]); *** 1_7_7.706/src/comp_w8.c Mon, 28 Apr 2003 00:35:06 -0500 dunemush (pennmush/f/33_comp_w8.c 1.13 660) --- 1_7_7.711(w)/src/comp_w8.c Thu, 30 Oct 2003 10:06:39 -0600 dunemush (pennmush/f/33_comp_w8.c 1.14 660) *************** *** 213,219 **** words[i] = malloc(wordpos); if (!words[i]) ! panic("Out of memory in string compression routine"); #ifdef COMP_STATS total_mallocs += wordpos; --- 213,219 ---- words[i] = malloc(wordpos); if (!words[i]) ! mush_panic("Out of memory in string compression routine"); #ifdef COMP_STATS total_mallocs += wordpos; *************** *** 322,328 **** } else { panicking = 1; /* don't panic from within panic */ fprintf(stderr, "Error in string decompression, i = %i\n", i); ! panic("Fatal error in decompression"); } } strncpy((char *) b, words[i], words_len[i]); --- 322,328 ---- } else { panicking = 1; /* don't panic from within panic */ fprintf(stderr, "Error in string decompression, i = %i\n", i); ! mush_panic("Fatal error in decompression"); } } strncpy((char *) b, words[i], words_len[i]); *** 1_7_7.706/src/command.c Sun, 19 Oct 2003 09:57:03 -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.23 660) --- 1_7_7.711(w)/src/command.c Thu, 30 Oct 2003 10:06:38 -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.1.1.1.2.1.3.1.10.1.1.3.24 660) *************** *** 835,841 **** rs = (char *) mush_malloc(BUFFER_LEN, "string"); switches = (char *) mush_malloc(BUFFER_LEN, "string"); if (!command || !swtch || !ls || !rs || !switches) ! panic("Couldn't allocate memory in command_parse"); p = string; replacer = NULL; attrib = NULL; --- 835,841 ---- rs = (char *) mush_malloc(BUFFER_LEN, "string"); switches = (char *) mush_malloc(BUFFER_LEN, "string"); if (!command || !swtch || !ls || !rs || !switches) ! mush_panic("Couldn't allocate memory in command_parse"); p = string; replacer = NULL; attrib = NULL; *** 1_7_7.706/src/bsd.c Tue, 07 Oct 2003 00:36:44 -0500 dunemush (pennmush/c/38_bsd.c 1.58.1.11.1.2.1.5.1.7.1.14.1.13.1.9.1.4.1.2.1.12.1.1.1.1.1.2.1.1.1.13.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.8.2.1.1.1.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.4 660) --- 1_7_7.711(w)/src/bsd.c Thu, 30 Oct 2003 10:06:38 -0600 dunemush (pennmush/c/38_bsd.c 1.58.1.11.1.2.1.5.1.7.1.14.1.13.1.9.1.4.1.2.1.12.1.1.1.1.1.2.1.1.1.13.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.8.2.1.1.1.1.1.1.1.1.2.1.1.1.1.1.1.1.1.1.1.1.1.1.5 660) *************** *** 1675,1681 **** DESC *d; d = (DESC *) mush_malloc(sizeof(DESC), "descriptor"); if (!d) ! panic("Out of memory."); d->descriptor = s; d->connected = 0; d->connected_at = mudtime; --- 1675,1681 ---- DESC *d; d = (DESC *) mush_malloc(sizeof(DESC), "descriptor"); if (!d) ! mush_panic("Out of memory."); d->descriptor = s; d->connected = 0; d->connected_at = mudtime; *************** *** 2495,2501 **** (unsigned char *) mush_malloc(sizeof(char) * MAX_COMMAND_LEN, "descriptor_raw_input"); if (!d->raw_input) ! panic("Out of memory"); d->raw_input_at = d->raw_input; } p = d->raw_input_at; --- 2495,2501 ---- (unsigned char *) mush_malloc(sizeof(char) * MAX_COMMAND_LEN, "descriptor_raw_input"); if (!d->raw_input) ! mush_panic("Out of memory"); d->raw_input_at = d->raw_input; } p = d->raw_input_at; *************** *** 3310,3316 **** { char tbuf1[BUFFER_LEN]; sprintf(tbuf1, T("BAILOUT: caught signal %d"), sig); ! panic(tbuf1); _exit(7); } --- 3310,3316 ---- { char tbuf1[BUFFER_LEN]; sprintf(tbuf1, T("BAILOUT: caught signal %d"), sig); ! mush_panic(tbuf1); _exit(7); } *** 1_7_7.706/src/boolexp.c Wed, 02 Jul 2003 22:35:12 -0500 dunemush (pennmush/c/39_boolexp.c 1.1.1.17.1.1.1.13.1.2.1.10 660) --- 1_7_7.711(w)/src/boolexp.c Thu, 30 Oct 2003 10:06:38 -0600 dunemush (pennmush/c/39_boolexp.c 1.1.1.17.1.1.1.13.1.2.1.11 660) *************** *** 550,555 **** --- 550,580 ---- } } + /** Pretty-print object references for unparse_boolexp(). + * \param player the object seeing the decompiled lock. + * \param thing the object referenced in the lock. + * \param flag How to print thing. + * \param buff The start of the output buffer. + * \param bp Pointer to the current position in buff. + * \return 0 on success, true on buffer overflow. + */ + static int + safe_boref(dbref player, dbref thing, enum u_b_f flag, char *buff, char **bp) + { + switch (flag) { + case UB_MEREF: + if (player == thing) + return safe_strl("me", 2, buff, bp); + else + return safe_dbref(thing, buff, bp); + case UB_DBREF: + return safe_dbref(thing, buff, bp); + case UB_ALL: + default: + return safe_str(unparse_object(player, thing), buff, bp); + } + } + /** Display a boolexp. * This function returns the textual representation of the boolexp. * \param player The object wanting the decompiled boolexp. *************** *** 628,669 **** safe_chr(')', boolexp_buf, &buftop); break; case OP_TCONST: ! if (flag == UB_DBREF) ! safe_format(boolexp_buf, &buftop, "#%d", arg); ! else ! safe_str(unparse_object(player, arg), boolexp_buf, &buftop); break; case OP_TATR: safe_format(boolexp_buf, &buftop, "%s:%s", s, bytecode + arg); break; case OP_TIND: safe_chr(AT_TOKEN, boolexp_buf, &buftop); ! if (flag == UB_DBREF) ! safe_format(boolexp_buf, &buftop, "#%d", arg); ! else ! safe_str(unparse_object(player, arg), boolexp_buf, &buftop); safe_format(boolexp_buf, &buftop, "/%s", s); break; case OP_TCARRY: safe_chr(IN_TOKEN, boolexp_buf, &buftop); ! if (flag == UB_DBREF) ! safe_format(boolexp_buf, &buftop, "#%d", arg); ! else ! safe_str(unparse_object(player, arg), boolexp_buf, &buftop); break; case OP_TIS: safe_chr(IS_TOKEN, boolexp_buf, &buftop); ! if (flag == UB_DBREF) ! safe_format(boolexp_buf, &buftop, "#%d", arg); ! else ! safe_str(unparse_object(player, arg), boolexp_buf, &buftop); break; case OP_TOWNER: safe_chr(OWNER_TOKEN, boolexp_buf, &buftop); ! if (flag == UB_DBREF) ! safe_format(boolexp_buf, &buftop, "#%d", arg); ! else ! safe_str(unparse_object(player, arg), boolexp_buf, &buftop); break; case OP_TEVAL: safe_format(boolexp_buf, &buftop, "%s/%s", s, bytecode + arg); --- 653,679 ---- safe_chr(')', boolexp_buf, &buftop); break; case OP_TCONST: ! safe_boref(player, arg, flag, boolexp_buf, &buftop); break; case OP_TATR: safe_format(boolexp_buf, &buftop, "%s:%s", s, bytecode + arg); break; case OP_TIND: safe_chr(AT_TOKEN, boolexp_buf, &buftop); ! safe_boref(player, arg, flag, boolexp_buf, &buftop); safe_format(boolexp_buf, &buftop, "/%s", s); break; case OP_TCARRY: safe_chr(IN_TOKEN, boolexp_buf, &buftop); ! safe_boref(player, arg, flag, boolexp_buf, &buftop); break; case OP_TIS: safe_chr(IS_TOKEN, boolexp_buf, &buftop); ! safe_boref(player, arg, flag, boolexp_buf, &buftop); break; case OP_TOWNER: safe_chr(OWNER_TOKEN, boolexp_buf, &buftop); ! safe_boref(player, arg, flag, boolexp_buf, &buftop); break; case OP_TEVAL: safe_format(boolexp_buf, &buftop, "%s/%s", s, bytecode + arg); *************** *** 1189,1198 **** if (!found) { newstr = mush_malloc(sizeof *newstr, "bvm.strnode"); if (!s) ! panic(T("Unable to allocate memory for boolexp string node!")); newstr->s = mush_strdup(s, "bvm.string"); if (!newstr->s) ! panic(T("Unable to allocate memory for boolexp string!")); newstr->len = strlen(s) + 1; newstr->next = NULL; if (a->shead == NULL) --- 1199,1208 ---- if (!found) { newstr = mush_malloc(sizeof *newstr, "bvm.strnode"); if (!s) ! mush_panic(T("Unable to allocate memory for boolexp string node!")); newstr->s = mush_strdup(s, "bvm.string"); if (!newstr->s) ! mush_panic(T("Unable to allocate memory for boolexp string!")); newstr->len = strlen(s) + 1; newstr->next = NULL; if (a->shead == NULL) *************** *** 1208,1214 **** newop = mush_malloc(sizeof *newop, "bvm.asmnode"); if (!newop) ! panic(T("Unable to allocate memory for boolexp asm node!")); newop->op = op; newop->arg = arg; newop->next = NULL; --- 1218,1224 ---- newop = mush_malloc(sizeof *newop, "bvm.asmnode"); if (!newop) ! mush_panic(T("Unable to allocate memory for boolexp asm node!")); newop->op = op; newop->arg = arg; newop->next = NULL; *************** *** 1439,1445 **** struct bvm_asmnode *newlbl; newlbl = mush_malloc(sizeof *newlbl, "bvm.asmnode"); if (!newlbl) ! panic(T("Unable to allocate memory for boolexp asm node!")); newlbl->op = OP_LABEL; n->arg = newlbl->arg = gen_label_id(a); if (target->next) --- 1449,1455 ---- struct bvm_asmnode *newlbl; newlbl = mush_malloc(sizeof *newlbl, "bvm.asmnode"); if (!newlbl) ! mush_panic(T("Unable to allocate memory for boolexp asm node!")); newlbl->op = OP_LABEL; n->arg = newlbl->arg = gen_label_id(a); if (target->next) *** 1_7_7.706/src/attrib.c Sun, 19 Oct 2003 10:34:41 -0500 dunemush (pennmush/c/40_attrib.c 1.15.1.2.1.5.1.1.1.3.1.3.1.2.1.2.1.2.2.1.1.2.1.2.1.2.1.1.1.3.1.1.1.1.1.1.3.38 660) --- 1_7_7.711(w)/src/attrib.c Thu, 30 Oct 2003 10:06:38 -0600 dunemush (pennmush/c/40_attrib.c 1.15.1.2.1.5.1.1.1.3.1.3.1.2.1.2.1.2.2.1.1.2.1.2.1.2.1.1.1.3.1.1.1.1.1.1.3.42 660) *************** *** 1380,1386 **** int j; page = (ATTRPAGE *) mush_malloc(sizeof(ATTRPAGE), "ATTRPAGE"); if (!page) ! panic("Couldn't allocate memory in get_atr_free_list"); for (j = 0; j < ATTRS_PER_PAGE - 1; j++) AL_NEXT(page->atrs + j) = page->atrs + j + 1; AL_NEXT(page->atrs + ATTRS_PER_PAGE - 1) = NULL; --- 1380,1386 ---- int j; page = (ATTRPAGE *) mush_malloc(sizeof(ATTRPAGE), "ATTRPAGE"); if (!page) ! mush_panic("Couldn't allocate memory in get_atr_free_list"); for (j = 0; j < ATTRS_PER_PAGE - 1; j++) AL_NEXT(page->atrs + j) = page->atrs + j + 1; AL_NEXT(page->atrs + ATTRS_PER_PAGE - 1) = NULL; *************** *** 1455,1468 **** *p = '\0'; while (atr) { comp = strcoll(name, AL_NAME(atr)); ! if (comp < 0) goto continue_target; if (comp == 0) break; atr = AL_NEXT(atr); } ! if (!atr || (target != obj && (AL_FLAGS(atr) & AF_PRIVATE))) goto continue_target; if ((AL_FLAGS(atr) & AF_INTERNAL) || (AL_FLAGS(atr) & AF_MDARK) || !((AL_FLAGS(atr) & AF_VISUAL) || control || exam || (!visible && !Mistrust(player) && --- 1455,1472 ---- *p = '\0'; while (atr) { comp = strcoll(name, AL_NAME(atr)); ! if (comp < 0) { ! *p = '`'; goto continue_target; + } if (comp == 0) break; atr = AL_NEXT(atr); } ! if (!atr || (target != obj && (AL_FLAGS(atr) & AF_PRIVATE))) { ! *p = '`'; goto continue_target; + } if ((AL_FLAGS(atr) & AF_INTERNAL) || (AL_FLAGS(atr) & AF_MDARK) || !((AL_FLAGS(atr) & AF_VISUAL) || control || exam || (!visible && !Mistrust(player) && *************** *** 1482,1488 **** } continue_target: - *p = '`'; /* Attribute wasn't on this object. Check a parent or ancestor. */ parent_depth++; --- 1486,1491 ---- *** 1_7_7.706/hdrs/version.h Sun, 19 Oct 2003 10:39:36 -0500 dunemush (pennmush/c/47_version.h 1.32.1.2.1.7.1.9.1.1.1.17.1.28 660) --- 1_7_7.711(w)/hdrs/version.h Thu, 30 Oct 2003 10:06:43 -0600 dunemush (pennmush/c/47_version.h 1.32.1.2.1.7.1.9.1.1.1.17.1.29 660) *************** *** 1,3 **** ! #define VERSION "PennMUSH version 1.7.7 patchlevel 24 [10/19/2003]" ! #define SHORTVN "PennMUSH 1.7.7p24" ! #define NUMVERSION 001007007024 --- 1,3 ---- ! #define VERSION "PennMUSH version 1.7.7 patchlevel 25 [10/30/2003]" ! #define SHORTVN "PennMUSH 1.7.7p25" ! #define NUMVERSION 001007007025 *** 1_7_7.706/hdrs/externs.h Tue, 30 Sep 2003 16:39:26 -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.2 660) --- 1_7_7.711(w)/hdrs/externs.h Thu, 30 Oct 2003 10:06:43 -0600 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.3 660) *************** *** 63,69 **** extern void init_game_postdb(const char *conf); extern void init_game_config(const char *conf); extern void dump_database(void); ! extern void NORETURN panic(const char *message); extern char *scan_list(dbref player, char *command); --- 63,69 ---- extern void init_game_postdb(const char *conf); extern void init_game_config(const char *conf); extern void dump_database(void); ! extern void NORETURN mush_panic(const char *message); extern char *scan_list(dbref player, char *command); *** 1_7_7.706/src/mysocket.c Wed, 01 Oct 2003 18:10:04 -0500 dunemush (pennmush/f/0_mysocket.c 1.16.1.1.1.1.1.1.1.4.1.4.1.12 660) --- 1_7_7.711(w)/src/mysocket.c Thu, 30 Oct 2003 10:06:41 -0600 dunemush (pennmush/f/0_mysocket.c 1.16.1.1.1.1.1.1.1.4.1.4.1.13 660) *************** *** 343,349 **** if ((flags = fcntl(s, F_GETFL, 0)) == -1) { perror("make_nonblocking: fcntl"); #ifndef INFOSLAVE ! panic("F_GETFL fcntl failed"); #else exit(1); #endif --- 343,349 ---- if ((flags = fcntl(s, F_GETFL, 0)) == -1) { perror("make_nonblocking: fcntl"); #ifndef INFOSLAVE ! mush_panic("F_GETFL fcntl failed"); #else exit(1); #endif *************** *** 353,359 **** #endif /* WIN32 */ perror("make_nonblocking: fcntl"); #ifndef INFOSLAVE ! panic("O_NDELAY fcntl failed"); #else exit(1); #endif --- 353,359 ---- #endif /* WIN32 */ perror("make_nonblocking: fcntl"); #ifndef INFOSLAVE ! mush_panic("O_NDELAY fcntl failed"); #else exit(1); #endif *** 1_7_7.706/hdrs/boolexp.h Wed, 02 Jul 2003 14:19:13 -0500 dunemush (pennmush/f/22_boolexp.h 1.12 660) --- 1_7_7.711(w)/hdrs/boolexp.h Thu, 30 Oct 2003 10:06:42 -0600 dunemush (pennmush/f/22_boolexp.h 1.13 660) *************** *** 24,29 **** extern void free_boolexp(boolexp b); boolexp getboolexp(FILE * f, const char *ltype); void putboolexp(FILE * f, boolexp b); ! enum u_b_f { UB_ALL, UB_DBREF }; extern char *unparse_boolexp(dbref player, boolexp b, enum u_b_f flag); #endif /* BOOLEXP_H */ --- 24,34 ---- extern void free_boolexp(boolexp b); boolexp getboolexp(FILE * f, const char *ltype); void putboolexp(FILE * f, boolexp b); ! enum u_b_f { ! UB_ALL, /**< Use names of objects */ ! UB_DBREF, /**< Use dbrefs */ ! UB_MEREF /**< Use dbrefs or "me" if the object is the player arg ! from unparse_boolexp.() For @decompile. */ ! }; extern char *unparse_boolexp(dbref player, boolexp b, enum u_b_f flag); #endif /* BOOLEXP_H */ *** 1_7_7.706/game/txt/hlp/pennvOLD.hlp Sun, 19 Oct 2003 10:34:41 -0500 dunemush (pennmush/g/30_pennvOLD.h 1.1.1.1.1.1.1.1.1.1.1.1.1.6 660) --- 1_7_7.711(w)/game/txt/hlp/pennvOLD.hlp Thu, 30 Oct 2003 10:06:44 -0600 dunemush (pennmush/g/30_pennvOLD.h 1.1.1.1.1.1.1.1.1.1.1.1.1.7 660) *************** *** 4418,4424 **** type 'help p'. For example, 'help 1.7.2p3' 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 1.7.6: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 1.7.5: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 1.7.4: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, --- 4418,4424 ---- type 'help p'. For example, 'help 1.7.2p3' 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 1.7.6: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 1.7.5: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 1.7.4: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, *** 1_7_7.706/game/txt/hlp/pennv177.hlp Mon, 20 Oct 2003 21:29:07 -0500 dunemush (pennmush/g/34_pennv177.h 1.176 660) --- 1_7_7.711(w)/game/txt/hlp/pennv177.hlp Thu, 30 Oct 2003 10:06:43 -0600 dunemush (pennmush/g/34_pennv177.h 1.179 660) *************** *** 1,4 **** ! & 1.7.7p24 & 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.7.7p25 & 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,33 ---- A list of the patchlevels associated with each release can be read in 'help patchlevels'. + Version 1.7.7 patchlevel 25 October 30, 2003 + + Fixes: + * Crash bug in the interaction between parents and attr trees + fixed. Report by Walker@M*U*S*H. + * Improvements to how locks are decompiled. Built-in locks with the + no_inherit flag cleared are handled better. If the object doing + the @decompile is referenced in a lock key, it's decompiled as 'me' + rather than by dbref, to make it easier to port between games. + Report by Cerekk@bDv. [SW] + * The error typically logged by info_slave on a mush crash is worded + better. [SW] + * panic() renamed mush_panic() as the Mach kernel now has a public + system call panic(). Report by Jeff Ferrell. + + + & 1.7.7p24 Version 1.7.7 patchlevel 24 October 19, 2003 Minor Changes: *** 1_7_7.706/src/notify.c Mon, 20 Oct 2003 21:29:07 -0500 dunemush (pennmush/g/35_notify.c 1.33 660) --- 1_7_7.711(w)/src/notify.c Thu, 30 Oct 2003 10:06:41 -0600 dunemush (pennmush/g/35_notify.c 1.34 660) *************** *** 1185,1195 **** p = (struct text_block *) mush_malloc(sizeof(struct text_block), "text_block"); if (!p) ! panic("Out of memory"); p->buf = (unsigned char *) mush_malloc(sizeof(unsigned char) * n, "text_block_buff"); if (!p->buf) ! panic("Out of memory"); memcpy(p->buf, s, n); p->nchars = n; --- 1185,1195 ---- p = (struct text_block *) mush_malloc(sizeof(struct text_block), "text_block"); if (!p) ! mush_panic("Out of memory"); p->buf = (unsigned char *) mush_malloc(sizeof(unsigned char) * n, "text_block_buff"); if (!p->buf) ! mush_panic("Out of memory"); memcpy(p->buf, s, n); p->nchars = n; *** 1_7_7.706/src/chunk.c Thu, 09 Oct 2003 19:20:51 -0500 dunemush (pennmush/g/38_chunk.c 1.31 660) --- 1_7_7.711(w)/src/chunk.c Thu, 30 Oct 2003 10:06:38 -0600 dunemush (pennmush/g/38_chunk.c 1.32 660) *************** *** 677,683 **** pos < REGION_SIZE; pos += ChunkFullLen(region, pos)) { if (pos == offset) { if ((ChunkPointer(region, pos)[0] & CHUNK_FREE_MASK) == CHUNK_FREE) ! panic("Invalid reference to used chunk"); return; } } --- 677,683 ---- pos < REGION_SIZE; pos += ChunkFullLen(region, pos)) { if (pos == offset) { if ((ChunkPointer(region, pos)[0] & CHUNK_FREE_MASK) == CHUNK_FREE) ! mush_panic("Invalid reference to used chunk"); return; } } *************** *** 1143,1152 **** #endif if (j >= 3) #ifdef WIN32 ! panic(tprintf("chunk swap file seek, GetLastError %d", GetLastError())); #else ! panic(tprintf("chunk swap file seek, errno %d: %s", ! errno, strerror(errno))); #endif pos = (char *) rhp; remaining = REGION_SIZE; --- 1143,1153 ---- #endif if (j >= 3) #ifdef WIN32 ! mush_panic(tprintf ! ("chunk swap file seek, GetLastError %d", GetLastError())); #else ! mush_panic(tprintf("chunk swap file seek, errno %d: %s", ! errno, strerror(errno))); #endif pos = (char *) rhp; remaining = REGION_SIZE; *************** *** 1170,1180 **** #endif } #ifdef WIN32 ! panic(tprintf("chunk swap file read, %d remaining, GetLastError %d", ! remaining, GetLastError())); #else ! panic(tprintf("chunk swap file read, %d remaining, errno %d: %s", ! remaining, errno, strerror(errno))); #endif } --- 1171,1181 ---- #endif } #ifdef WIN32 ! mush_panic(tprintf("chunk swap file read, %d remaining, GetLastError %d", ! remaining, GetLastError())); #else ! mush_panic(tprintf("chunk swap file read, %d remaining, errno %d: %s", ! remaining, errno, strerror(errno))); #endif } *************** *** 1203,1212 **** #endif if (j >= 3) #ifdef WIN32 ! panic(tprintf("chunk swap file seek, GetLastError %d", GetLastError())); #else ! panic(tprintf("chunk swap file seek, errno %d: %s", ! errno, strerror(errno))); #endif pos = (char *) rhp; remaining = REGION_SIZE; --- 1204,1214 ---- #endif if (j >= 3) #ifdef WIN32 ! mush_panic(tprintf ! ("chunk swap file seek, GetLastError %d", GetLastError())); #else ! mush_panic(tprintf("chunk swap file seek, errno %d: %s", ! errno, strerror(errno))); #endif pos = (char *) rhp; remaining = REGION_SIZE; *************** *** 1230,1240 **** #endif } #ifdef WIN32 ! panic(tprintf("chunk swap file write, %d remaining, GetLastError %d", ! remaining, GetLastError())); #else ! panic(tprintf("chunk swap file write, %d remaining, errno %d: %s", ! remaining, errno, strerror(errno))); #endif } --- 1232,1242 ---- #endif } #ifdef WIN32 ! mush_panic(tprintf("chunk swap file write, %d remaining, GetLastError %d", ! remaining, GetLastError())); #else ! mush_panic(tprintf("chunk swap file write, %d remaining, errno %d: %s", ! remaining, errno, strerror(errno))); #endif } *************** *** 1255,1261 **** #endif rhp = mush_malloc(REGION_SIZE, "chunk region cache buffer"); if (!rhp) { ! panic("chunk region cache buffer allocation failure"); } cached_region_count++; rhp->region_id = INVALID_REGION_ID; --- 1257,1263 ---- #endif rhp = mush_malloc(REGION_SIZE, "chunk region cache buffer"); if (!rhp) { ! mush_panic("chunk region cache buffer allocation failure"); } cached_region_count++; rhp->region_id = INVALID_REGION_ID; *************** *** 1394,1400 **** #endif regions = (Region *) realloc(regions, region_array_len * sizeof(Region)); if (!regions) ! panic("chunk: region array realloc failure"); } region = region_count; region_count++; --- 1396,1402 ---- #endif regions = (Region *) realloc(regions, region_array_len * sizeof(Region)); if (!regions) ! mush_panic("chunk: region array realloc failure"); } region = region_count; region_count++; *************** *** 1640,1646 **** ASSERT(region < region_count); #ifdef CHUNK_PARANOID if (!region_is_valid(region)) ! panic("Invalid region in migrate_scan_region!"); #endif if (!rp->in_memory) --- 1642,1648 ---- ASSERT(region < region_count); #ifdef CHUNK_PARANOID if (!region_is_valid(region)) ! mush_panic("Invalid region in migrate_scan_region!"); #endif if (!rp->in_memory) *************** *** 1665,1671 **** pos += ChunkFullLen(region, pos); if (pos != offset || (ChunkPointer(region, pos)[0] & CHUNK_FREE_MASK) == CHUNK_FREE) ! panic("Invalid reference to used chunk in migrate"); k++; } } --- 1667,1673 ---- pos += ChunkFullLen(region, pos); if (pos != offset || (ChunkPointer(region, pos)[0] & CHUNK_FREE_MASK) == CHUNK_FREE) ! mush_panic("Invalid reference to used chunk in migrate"); k++; } } *************** *** 1750,1756 **** mush_malloc(count * sizeof(*m_unhappiness), "migrate unhappiness"); m_derefs = mush_malloc(count * sizeof(*m_derefs), "migrate derefs"); if (!m_length || !m_unhappiness || !m_derefs) ! panic("Cannot allocate working space for migration"); m_alloc = count; } m_count = count; --- 1752,1758 ---- mush_malloc(count * sizeof(*m_unhappiness), "migrate unhappiness"); m_derefs = mush_malloc(count * sizeof(*m_derefs), "migrate derefs"); if (!m_length || !m_unhappiness || !m_derefs) ! mush_panic("Cannot allocate working space for migration"); m_alloc = count; } m_count = count; *************** *** 2363,2369 **** u_int_16 full_len, region, offset; if (len < MIN_CHUNK_LEN || len > MAX_CHUNK_LEN) ! panic(tprintf("Illegal chunk length requested: %d bytes", len)); full_len = LenToFullLen(len); region = find_best_region(full_len, derefs, UNHAPPINESS_NEVER); --- 2365,2371 ---- u_int_16 full_len, region, offset; if (len < MIN_CHUNK_LEN || len > MAX_CHUNK_LEN) ! mush_panic(tprintf("Illegal chunk length requested: %d bytes", len)); full_len = LenToFullLen(len); region = find_best_region(full_len, derefs, UNHAPPINESS_NEVER); *************** *** 2382,2388 **** touch_cache_region(regions[region].in_memory); #ifdef CHUNK_PARANOID if (!region_is_valid(region)) ! panic("Invalid region after chunk_create!"); #endif stat_create++; return ChunkReference(region, offset); --- 2384,2390 ---- touch_cache_region(regions[region].in_memory); #ifdef CHUNK_PARANOID if (!region_is_valid(region)) ! mush_panic("Invalid region after chunk_create!"); #endif stat_create++; return ChunkReference(region, offset); *************** *** 2406,2412 **** touch_cache_region(regions[region].in_memory); #ifdef CHUNK_PARANOID if (!region_is_valid(region)) ! panic("Invalid region after chunk_delete!"); #endif stat_delete++; } --- 2408,2414 ---- touch_cache_region(regions[region].in_memory); #ifdef CHUNK_PARANOID if (!region_is_valid(region)) ! mush_panic("Invalid region after chunk_delete!"); #endif stat_delete++; } *************** *** 2593,2603 **** swap_fd = CreateFile(CHUNK_SWAP_FILE, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, NULL); if (swap_fd == INVALID_HANDLE_VALUE) ! panic(tprintf("Cannot open swap file: %d", GetLastError())); #else swap_fd = open(CHUNK_SWAP_FILE, O_RDWR | O_TRUNC | O_CREAT, 0600); if (swap_fd < 0) ! panic(tprintf("Cannot open swap file: %s", strerror(errno))); #endif curr_period = 0; --- 2595,2605 ---- swap_fd = CreateFile(CHUNK_SWAP_FILE, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, NULL); if (swap_fd == INVALID_HANDLE_VALUE) ! mush_panic(tprintf("Cannot open swap file: %d", GetLastError())); #else swap_fd = open(CHUNK_SWAP_FILE, O_RDWR | O_TRUNC | O_CREAT, 0600); if (swap_fd < 0) ! mush_panic(tprintf("Cannot open swap file: %s", strerror(errno))); #endif curr_period = 0; *************** *** 2612,2618 **** #endif regions = mush_malloc(region_array_len * sizeof(Region), "chunk region list"); if (!regions) ! panic("cannot malloc space for chunk region list"); /* command_add("@DEBUGCHUNK", CMD_T_ANY | CMD_T_GOD, 0, 0, 0, --- 2614,2620 ---- #endif regions = mush_malloc(region_array_len * sizeof(Region), "chunk region list"); if (!regions) ! mush_panic("cannot malloc space for chunk region list"); /* command_add("@DEBUGCHUNK", CMD_T_ANY | CMD_T_GOD, 0, 0, 0,