This is patch04 to PennMUSH 1.7.4. After applying this patch, you will have version 1.7.4p4 To apply this patch, save it to a file in your top-level MUSH directory, and do the following: patch -p1 < 1.7.4-patch04 make install If you use GNU patch 2.2, you probably want the above to be 'patch -b -p1', not just 'patch -p1'. Then @shutdown and restart your MUSH. - Alan/Javelin In this patch: Minor changes: * Internally, the /folder switch is now /folders, which prefix-matches to /folder and also lets @mail/folders work as syntactic sugar. * fun_ansi has been rewritten to use less buffer space by consolidating ansi codes. New codes for turning off ansi attributes (like hilite) also added. Patch by Luke@M*U*S*H. * /silent switch to give suppresses default messages when giving money to players. Suggested by 8BitMUSH. * Old port concentrator code removed. [SW] * On linux, @uptime reads /proc files instead of running 'uptime' [SW] * Code that uses strdup and then adds a MEM_CHECK record for "string" now use a wrapper function that does it automatically. [SW] Fixes: * Paging a page-locked player didn't give the appropriate messages. Reported by Steven@Champions. * left, right, and mid are now ansi-aware. Patch by Luke@M*U*S*H. * Help fixes to lexits(), name() (Noltar@Korongil), 1.7.4p3 (Matrim@M*U*S*H). * win32/cmds.h updated with prototypes for dismiss and desert by Noltar@Korongil. And hdrs/externs.h, too, by [SW]. * Memory leak with using alphabetic q-registers in queued commands fixed. Report by Jayvin@Dynamix [SW] * Added hints/openbsd.sh to distribution. * Mac portability linting. [DW] * Several memory leaks in @malias code fixed. [SW] Prereq: 1.7.4p3 *** 1_7_4.82/Patchlevel Fri, 06 Apr 2001 15:24:09 -0500 dunemush (pennmush/5_Patchlevel 1.21 600) --- 1_7_4.93(w)/Patchlevel Tue, 24 Apr 2001 12:03:11 -0500 dunemush (pennmush/5_Patchlevel 1.22 600) *************** *** 1,2 **** Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.7.4p3 --- 1,2 ---- Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.7.4p4 *** 1_7_4.82/CHANGES Mon, 23 Apr 2001 18:06:35 -0500 dunemush (pennmush/8_CHANGES 1.204 600) --- 1_7_4.93(w)/CHANGES Tue, 15 May 2001 15:59:37 -0500 dunemush (pennmush/8_CHANGES 1.212 600) *************** *** 17,27 **** ========================================================================== Version 1.7.4 patchlevel 3 April 23, 2001 Commands: * unfollow with no args now stops you from following everyone. ! dismiss command stops people from followig you. desert command stops people from following you or leading you. Idea by Oriens@Alexandria. Names suggested by Noltar@Korongil Minor changes: --- 17,54 ---- ========================================================================== + Version 1.7.4 patchlevel 4 May 13, 2001 + + Minor changes: + * Internally, the /folder switch is now /folders, which prefix-matches + to /folder and also lets @mail/folders work as syntactic sugar. + * fun_ansi has been rewritten to use less buffer space by consolidating + ansi codes. New codes for turning off ansi attributes (like hilite) + also added. Patch by Luke@M*U*S*H. + * /silent switch to give suppresses default messages when giving + money to players. Suggested by 8BitMUSH. + * Old port concentrator code removed. [SW] + * On linux, @uptime reads /proc files instead of running 'uptime' [SW] + * Code that uses strdup and then adds a MEM_CHECK record for "string" + now use a wrapper function that does it automatically. [SW] + Fixes: + * Paging a page-locked player didn't give the appropriate messages. + Reported by Steven@Champions. + * left, right, and mid are now ansi-aware. Patch by Luke@M*U*S*H. + * Help fixes to lexits(), name() (Noltar@Korongil), 1.7.4p3 (Matrim@M*U*S*H). + * win32/cmds.h updated with prototypes for dismiss and desert by + Noltar@Korongil. And hdrs/externs.h, too, by [SW]. + * Memory leak with using alphabetic q-registers in queued commands fixed. + Report by Jayvin@Dynamix [SW] + * Added hints/openbsd.sh to distribution. + * Mac portability linting. [DW] + * Several memory leaks in @malias code fixed. [SW] + Version 1.7.4 patchlevel 3 April 23, 2001 Commands: * unfollow with no args now stops you from following everyone. ! dismiss command stops people from following you. desert command stops people from following you or leading you. Idea by Oriens@Alexandria. Names suggested by Noltar@Korongil Minor changes: *** 1_7_4.82/game/txt/hlp/pennvers.hlp Mon, 23 Apr 2001 18:06:35 -0500 dunemush (pennmush/12_pennvers.h 1.153 600) --- 1_7_4.93(w)/game/txt/hlp/pennvers.hlp Thu, 24 May 2001 16:10:23 -0500 dunemush (pennmush/12_pennvers.h 1.162 600) *************** *** 1,5 **** & changes ! & 1.7.4p3 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.4p4 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,21 **** A list of the patchlevels associated with each release can be read in 'help patchlevels'. Version 1.7.4 patchlevel 3 April 23, 2001 Commands: * unfollow with no args now stops you from following everyone. ! dismiss command stops people from followig you. desert command stops people from following you or leading you. Idea by Oriens@Alexandria. Names suggested by Noltar@Korongil Minor changes: --- 11,49 ---- A list of the patchlevels associated with each release can be read in 'help patchlevels'. + Version 1.7.4 patchlevel 4 May 13, 2001 + + Minor changes: + * Internally, the /folder switch is now /folders, which prefix-matches + to /folder and also lets @mail/folders work as syntactic sugar. + * fun_ansi has been rewritten to use less buffer space by consolidating + ansi codes. New codes for turning off ansi attributes (like hilite) + also added. Patch by Luke@M*U*S*H. + * /silent switch to give suppresses default messages when giving + money to players. Suggested by 8BitMUSH. + * Old port concentrator code removed. [SW] + * On linux, @uptime reads /proc files instead of running 'uptime' [SW] + * Code that uses strdup and then adds a MEM_CHECK record for "string" + now use a wrapper function that does it automatically. [SW] + Fixes: + * Paging a page-locked player didn't give the appropriate messages. + Reported by Steven@Champions. + * left, right, and mid are now ansi-aware. Patch by Luke@M*U*S*H. + * Help fixes to lexits(), name() (Noltar@Korongil), 1.7.4p3 (Matrim@M*U*S*H). + * win32/cmds.h updated with prototypes for dismiss and desert by + Noltar@Korongil. And hdrs/externs.h, too, by [SW]. + * Memory leak with using alphabetic q-registers in queued commands fixed. + Report by Jayvin@Dynamix [SW] + * Added hints/openbsd.sh to distribution. + * Mac portability linting. [DW] + * Several memory leaks in @malias code fixed. [SW] + + & 1.7.4p3 Version 1.7.4 patchlevel 3 April 23, 2001 Commands: * unfollow with no args now stops you from following everyone. ! dismiss command stops people from following you. desert command stops people from following you or leading you. Idea by Oriens@Alexandria. Names suggested by Noltar@Korongil Minor changes: *************** *** 4618,4624 **** is configurable. & patchlevels ! 1.7.4: 0, 1, 2, 3 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 --- 4646,4655 ---- is configurable. & patchlevels ! 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 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.82/game/txt/hlp/pennfunc.hlp Wed, 04 Apr 2001 13:10:52 -0500 dunemush (pennmush/16_pennfunc.h 1.2.1.50.1.1.1.1.1.2.1.3 600) --- 1_7_4.93(w)/game/txt/hlp/pennfunc.hlp Wed, 25 Apr 2001 14:22:13 -0500 dunemush (pennmush/16_pennfunc.h 1.2.1.50.1.1.1.1.1.2.1.7 600) *************** *** 290,302 **** & ANSI() ansi(,) ! This allows you to highlight a string using ANSI terminal effects. The ! string is terminated with a "return to normal" code, and the codes are ! utilized in the order they are specified. The codes are: ! ! f - flash i - inverse ! h - hilite n - normal ! u - underscore x - black foreground X - black background r - red foreground R - red background --- 290,303 ---- & ANSI() ansi(,) ! This allows you to highlight a string using ANSI terminal effects. ! The codes are: ! ! f - flash F - not flash ! h - hilite H - not hilite ! u - underscore U - not underscore ! i - inverse I - not inverse ! n - normal x - black foreground X - black background r - red foreground R - red background *************** *** 1477,1485 **** & LEXITS() lexits() ! Returns a list of the dbrefs of all the non-dark exits in the room. ! If you are not in the room, you must control it in order to get the ! list of exits. & LJUST() ljust(,[,]) --- 1478,1486 ---- & LEXITS() lexits() ! Returns a list of the dbrefs of all the exits in the room visible to ! the executor. If you are not in the room, you must control it in order ! to get the list of exits. & LJUST() ljust(,[,]) *************** *** 2011,2022 **** need an unprivileged who-list. & NAME() name([,]) Name returns the name of object . For exits, name returns the displayed name of the exit. If function side effects are allowed, this function, given two arguments, ! will rename to . Related functions: FULLNAME() & NAND() --- 2012,2025 ---- need an unprivileged who-list. & NAME() name([,]) + name([, ]) Name returns the name of object . For exits, name returns the displayed name of the exit. If function side effects are allowed, this function, given two arguments, ! acts just like @name =. Consequently, if renaming ! a player, you must use the player's password or be God. Related functions: FULLNAME() & NAND() *** 1_7_4.82/game/txt/hlp/penncmd.hlp Sat, 07 Apr 2001 13:33:48 -0500 dunemush (pennmush/18_penncmd.hl 1.2.1.1.1.47.1.1.1.1.1.2 600) --- 1_7_4.93(w)/game/txt/hlp/penncmd.hlp Fri, 11 May 2001 15:35:56 -0500 dunemush (pennmush/18_penncmd.hl 1.2.1.1.1.47.1.1.1.1.1.3 600) *************** *** 3193,3208 **** See also: @lock, ENTER_OK, give, drop, @success, inventory & give ! give = ! Gives player the specified number of pennies or . You can't give someone pennies if their new total would be greater than 10000 pennies. ! (No reason to get greedy) You may also give players objects, but the ! other player must be set ENTER_OK in order to receive something you give. ! Giving money to an object gives the money to the object's owner. Some ! MUSHes may have @lock/give enabled, which determines who is allowed to ! give an object. See also: @pay, @cost, @lock, inventory, @receive, @give & go --- 3193,3213 ---- See also: @lock, ENTER_OK, give, drop, @success, inventory & give ! give[/silent] = ! give = ! Gives player the specified of pennies or . You can't give someone pennies if their new total would be greater than 10000 pennies. ! (No reason to get greedy). The /silent switch suppresses the default ! message indicating how many pennies were given. Wizards may "give" ! a negative number of pennies. ! ! You may also give players objects, but the other player must be set ! ENTER_OK in order to receive something you give. ! Giving money to an object gives the money to the object's owner. Some ! MUSHes may have @lock/give enabled, which determines who is allowed ! to give an object. See also: @pay, @cost, @lock, inventory, @receive, @give & go *** 1_7_4.82/src/SWITCHES Tue, 09 Jan 2001 17:56:37 -0600 dunemush (pennmush/b/22_SWITCHES 1.9 600) --- 1_7_4.93(w)/src/SWITCHES Tue, 24 Apr 2001 12:36:47 -0500 dunemush (pennmush/b/22_SWITCHES 1.10 600) *************** *** 36,43 **** FILE FIRST FLAGS ! FOLDER ! FOO FORWARD FSTATS FULL --- 36,42 ---- FILE FIRST FLAGS ! FOLDERS FORWARD FSTATS FULL *** 1_7_4.82/src/wiz.c Thu, 29 Mar 2001 15:36:57 -0600 dunemush (pennmush/b/23_wiz.c 1.44 660) --- 1_7_4.93(w)/src/wiz.c Sun, 13 May 2001 08:36:13 -0500 dunemush (pennmush/b/23_wiz.c 1.44.1.1.1.1 660) *************** *** 81,89 **** int tport_dest_ok _((dbref player, dbref victim, dbref dest)); int tport_control_ok _((dbref player, dbref victim, dbref loc)); - #ifdef CONCENTRATOR - int parse_conc_descriptor _((char *str, int cport, int port)); - #endif static int mem_usage _((dbref thing)); #ifdef INFO_SLAVE --- 81,86 ---- *************** *** 193,199 **** if (limit < owned) /* always have enough quota for your objects */ limit = owned; ! (void) atr_add(Owner(who), "RQUOTA", tprintf("%d", limit - owned), GOD, NOTHING); notify(player, tprintf(T("Objects: %d Limit: %d"), owned, limit)); } --- 190,197 ---- if (limit < owned) /* always have enough quota for your objects */ limit = owned; ! (void) atr_add(Owner(who), "RQUOTA", tprintf("%d", limit - owned), GOD, ! NOTHING); notify(player, tprintf(T("Objects: %d Limit: %d"), owned, limit)); } *************** *** 253,259 **** if (limit <= owned) (void) atr_add(who, "RQUOTA", "0", GOD, NOTHING); else ! (void) atr_add(who, "RQUOTA", tprintf("%d", limit - owned), GOD, NOTHING); } } if (limit == -1) --- 251,258 ---- if (limit <= owned) (void) atr_add(who, "RQUOTA", "0", GOD, NOTHING); else ! (void) atr_add(who, "RQUOTA", tprintf("%d", limit - owned), GOD, ! NOTHING); } } if (limit == -1) *************** *** 518,524 **** destination); if ((victim != player) && !(Puppet(victim) && (Owner(victim) == Owner(player)))) ! notify(player, T("Teleported.")); return; } /* we can't do it */ --- 517,523 ---- destination); if ((victim != player) && !(Puppet(victim) && (Owner(victim) == Owner(player)))) ! notify(player, T("Teleported.")); return; } /* we can't do it */ *************** *** 678,684 **** (T ("%d objects = %d rooms, %d exits, %d things, %d players, %d garbage."), si->total, si->rooms, si->exits, si->things, si->players, ! si->garbage)); if (first_free != NOTHING) notify(player, tprintf(T("The next object to be created will be #%d."), first_free)); --- 677,683 ---- (T ("%d objects = %d rooms, %d exits, %d things, %d players, %d garbage."), si->total, si->rooms, si->exits, si->things, si->players, ! si->garbage)); if (first_free != NOTHING) notify(player, tprintf(T("The next object to be created will be #%d."), first_free)); *************** *** 737,745 **** /* 2, self boot */ { dbref victim; - #ifdef CONCENTRATOR - int cport, port; - #endif DESC *d = NULL; victim = NOTHING; --- 736,741 ---- *************** *** 750,764 **** break; case 1: /* boot by descriptor */ - #ifdef CONCENTRATOR - if (!parse_conc_descriptor(name, &cport, &port)) { - notify(player, "Invalid descriptor specification (use d,d)."); - return; - } - victim = find_player_by_desc(cport, port); - #else victim = find_player_by_desc(atoi(name)); - #endif if (victim == NOTHING) { notify(player, "There is no one connected on that descriptor."); return; --- 746,752 ---- *************** *** 766,773 **** break; case 0: /* boot by name */ ! if ( ! (victim = noisy_match_result(player, name, TYPE_PLAYER, MAT_LIMITED | MAT_ME)) == NOTHING) { notify(player, T("No such connected player.")); --- 754,760 ---- break; case 0: /* boot by name */ ! if ((victim = noisy_match_result(player, name, TYPE_PLAYER, MAT_LIMITED | MAT_ME)) == NOTHING) { notify(player, T("No such connected player.")); *************** *** 792,802 **** d = player_desc(victim); break; case 1: - #ifdef CONCENTRATOR - d = port_desc(cport, port); - #else d = port_desc(atoi(name)); - #endif break; case 2: d = inactive_desc(victim); --- 779,785 ---- *************** *** 823,852 **** } } - #ifdef CONCENTRATOR - int - parse_conc_descriptor(str, cport, port) - char *str; - int *cport; - int *port; - { - char *p, *q; - - p = str; - q = str; - while (p && *p && (*p != ',')) - p++; - if (!p || !*p) - return 0; - *p = 0; - if (!(p + 1) || !*(p + 1)) - return 0; - *cport = atoi(q); - *port = atoi(p + 1); - return 1; - } - #endif /* CONCENTRATOR */ - void do_chownall(player, name, target) dbref player; --- 806,811 ---- *************** *** 869,878 **** if (!target || !*target) { n_target = player; } else { ! if ( ! (n_target = noisy_match_result(player, target, TYPE_PLAYER, ! MAT_LIMITED)) == NOTHING) return; } for (i = 0; i < db_top; i++) { --- 828,837 ---- if (!target || !*target) { n_target = player; } else { ! if ((n_target = noisy_match_result(player, target, TYPE_PLAYER, ! MAT_LIMITED)) == NOTHING) ! return; } for (i = 0; i < db_top; i++) { *************** *** 1101,1107 **** return; } if ((thing = noisy_match_result(player, name, NOTYPE, MAT_EVERYTHING)) == ! NOTHING) return; #ifdef ONLINE_REG if (Unregistered(thing)) { notify(player, T("You can't grant powers to unregistered players.")); --- 1060,1067 ---- return; } if ((thing = noisy_match_result(player, name, NOTYPE, MAT_EVERYTHING)) == ! NOTHING) ! return; #ifdef ONLINE_REG if (Unregistered(thing)) { notify(player, T("You can't grant powers to unregistered players.")); *************** *** 1500,1506 **** sclass = S_FLAG; if (restrict && *restrict && !convert_flags(player, (char *) restrict, &restrict_flags, ! &restrict_toggles, &restrict_type)) return -1; } else { notify(player, T("Unknown search class.")); return -1; --- 1460,1467 ---- sclass = S_FLAG; if (restrict && *restrict && !convert_flags(player, (char *) restrict, &restrict_flags, ! &restrict_toggles, &restrict_type)) ! return -1; } else { notify(player, T("Unknown search class.")); return -1; *************** *** 2050,2061 **** if (player == NOTHING) { flag_broadcast(0, 0, T ! ("GAME: Reboot w/o disconnect from game account, please wait."));} ! else { flag_broadcast(0, 0, T ("GAME: Reboot w/o disconnect by %s, please wait."), ! Name(Owner(player)));} if (flag) { paranoid_dump = 1; paranoid_checkpt = db_top / 5; --- 2011,2023 ---- if (player == NOTHING) { flag_broadcast(0, 0, T ! ("GAME: Reboot w/o disconnect from game account, please wait.")); ! } else { flag_broadcast(0, 0, T ("GAME: Reboot w/o disconnect by %s, please wait."), ! Name(Owner(player))); ! } if (flag) { paranoid_dump = 1; paranoid_checkpt = db_top / 5; *** 1_7_4.82/src/warnings.c Sat, 06 Jan 2001 12:01:09 -0600 dunemush (pennmush/b/25_warnings.c 1.16 660) --- 1_7_4.93(w)/src/warnings.c Sun, 13 May 2001 08:36:13 -0500 dunemush (pennmush/b/25_warnings.c 1.17 660) *************** *** 104,110 **** return W_UNLOCKED; if (l->type == BOOLEXP_CONST || l->type == BOOLEXP_CARRY || ! l->type == BOOLEXP_IS || l->type == BOOLEXP_OWNER) return W_LOCKED; return (W_LOCKED | W_UNLOCKED); } --- 104,111 ---- return W_UNLOCKED; if (l->type == BOOLEXP_CONST || l->type == BOOLEXP_CARRY || ! l->type == BOOLEXP_IS || l->type == BOOLEXP_OWNER) ! return W_LOCKED; return (W_LOCKED | W_UNLOCKED); } *** 1_7_4.82/src/unparse.c Mon, 30 Oct 2000 13:34:40 -0600 dunemush (pennmush/b/28_unparse.c 1.16 660) --- 1_7_4.93(w)/src/unparse.c Sun, 13 May 2001 08:36:13 -0500 dunemush (pennmush/b/28_unparse.c 1.16.1.1 660) *************** *** 95,101 **** couldunparse = 0; if (!(GoodObject(loc) || (loc == NOTHING) || (loc == AMBIGUOUS) || ! (loc == HOME))) return T("*NOTHING*"); switch (loc) { case NOTHING: return T("*NOTHING*"); --- 95,102 ---- couldunparse = 0; if (!(GoodObject(loc) || (loc == NOTHING) || (loc == AMBIGUOUS) || ! (loc == HOME))) ! return T("*NOTHING*"); switch (loc) { case NOTHING: return T("*NOTHING*"); *** 1_7_4.82/src/help.c Sun, 04 Mar 2001 18:27:45 -0600 dunemush (pennmush/f/32_help.c 1.4.1.2.1.1.1.3.2.2.1.1 660) --- 1_7_4.93(w)/src/help.c Tue, 15 May 2001 15:58:44 -0500 dunemush (pennmush/f/32_help.c 1.4.1.2.1.1.1.3.2.2.1.1.2.1 660) *************** *** 87,109 **** return; } ! h = mush_malloc(sizeof *h, "help_file_entry"); ! h->command = strdup(strupper(command_name)); ! #ifdef MEM_CHECK ! add_check("string"); ! #endif ! h->file = strdup(filename); ! #ifdef MEM_CHECK ! add_check("string"); ! #endif h->entries = 0; h->indx = NULL; h->admin = admin; help_build_index(h, h->admin); if (!h->indx) { ! mush_free(h->command, "string"); ! mush_free(h->file, "string"); ! mush_free(h, "help_file_entry"); return; } command_add(h->command, CMD_T_ANY | CMD_T_NOPARSE, 0, 0, 0, NULL, --- 87,103 ---- return; } ! h = mush_malloc(sizeof *h, "help_file.entry"); ! h->command = mush_strdup(strupper(command_name), "help_file.command"); ! h->file = mush_strdup(filename, "help_file.filename"); h->entries = 0; h->indx = NULL; h->admin = admin; help_build_index(h, h->admin); if (!h->indx) { ! mush_free(h->command, "help_file.command"); ! mush_free(h->file, "help_file.filename"); ! mush_free(h, "help_file.entry"); return; } command_add(h->command, CMD_T_ANY | CMD_T_NOPARSE, 0, 0, 0, NULL, *** 1_7_4.82/src/switchinc.c Mon, 26 Mar 2001 15:33:20 -0600 dunemush (pennmush/b/32_switchinc. 1.3.1.2.1.6.1.18.1.2.1.2.2.5.1.4.2.4 660) --- 1_7_4.93(w)/src/switchinc.c Sun, 13 May 2001 08:36:13 -0500 dunemush (pennmush/b/32_switchinc. 1.3.1.2.1.6.1.18.1.2.1.2.2.5.1.4.2.4.1.1 660) *************** *** 1,259 **** --- 1,388 ---- { "ACCESS", SWITCH_ACCESS} + , { "ADD", SWITCH_ADD} + , { "ALL", SWITCH_ALL} + , { "ATTRIBS", SWITCH_ATTRIBS} + , { "BAN", SWITCH_BAN} + , { "BLIND", SWITCH_BLIND} + , { "BRIEF", SWITCH_BRIEF} + , { "CHECK", SWITCH_CHECK} + , { "CHOWN", SWITCH_CHOWN} + , { "CLEAR", SWITCH_CLEAR} + , { "CMD", SWITCH_CMD} + , { "COMMANDS", SWITCH_COMMANDS} + , { "CONN", SWITCH_CONN} + , { "CONNECT", SWITCH_CONNECT} + , { "CONNECTED", SWITCH_CONNECTED} + , { "CONTENTS", SWITCH_CONTENTS} + , { "COSTS", SWITCH_COSTS} + , { "COUNT", SWITCH_COUNT} + , { "CREATE", SWITCH_CREATE} + , { "DATABASE", SWITCH_DATABASE} + , { "DB", SWITCH_DB} + , { "DEBUG", SWITCH_DEBUG} + , { "DECOMPILE", SWITCH_DECOMPILE} + , { "DEFAULTS", SWITCH_DEFAULTS} + , { "DELETE", SWITCH_DELETE} + , { "DELIM", SWITCH_DELIM} + , { "DESC", SWITCH_DESC} + , { "DESTROY", SWITCH_DESTROY} + , { "DISABLE", SWITCH_DISABLE} + , { "DOWN", SWITCH_DOWN} + , { "DSTATS", SWITCH_DSTATS} + , { "EMIT", SWITCH_EMIT} + , { "ENABLE", SWITCH_ENABLE} + , { "ERR", SWITCH_ERR} + , { "EXITS", SWITCH_EXITS} + , { "FILE", SWITCH_FILE} + , { "FIRST", SWITCH_FIRST} + , { "FLAGS", SWITCH_FLAGS} + , { "FOLDER", SWITCH_FOLDER} + , { "FOO", SWITCH_FOO} + , { "FORWARD", SWITCH_FORWARD} + , { "FSTATS", SWITCH_FSTATS} + , { "FULL", SWITCH_FULL} + , { "FUNCTIONS", SWITCH_FUNCTIONS} + , { "FWD", SWITCH_FWD} + , { "GAG", SWITCH_GAG} + , { "GLOBALS", SWITCH_GLOBALS} + , { "HEADER", SWITCH_HEADER} + , { "HERE", SWITCH_HERE} + , { "HIDE", SWITCH_HIDE} + , { "ILIST", SWITCH_ILIST} + , { "INVENTORY", SWITCH_INVENTORY} + , { "IPRINT", SWITCH_IPRINT} + , { "JOIN", SWITCH_JOIN} + , { "LIST", SWITCH_LIST} + , { "LOWERCASE", SWITCH_LOWERCASE} + , { "ME", SWITCH_ME} + , { "MEMBERS", SWITCH_MEMBERS} + , { "MOD", SWITCH_MOD} + , { "MORTAL", SWITCH_MORTAL} + , { "MOTD", SWITCH_MOTD} + , { "MUTE", SWITCH_MUTE} + , { "NAME", SWITCH_NAME} + , { "NO", SWITCH_NO} + , { "NOEVAL", SWITCH_NOEVAL} + , { "NOFLAGCOPY", SWITCH_NOFLAGCOPY} + , { "NOISY", SWITCH_NOISY} + , { "NOSIG", SWITCH_NOSIG} + , { "NOSPACE", SWITCH_NOSPACE} + , { "NOTIFY", SWITCH_NOTIFY} + , { "NUKE", SWITCH_NUKE} + , { "OFF", SWITCH_OFF} + , { "ON", SWITCH_ON} + , { "OUTSIDE", SWITCH_OUTSIDE} + , { "OVERRIDE", SWITCH_OVERRIDE} + , { "PANIC", SWITCH_PANIC} + , { "PARANOID", SWITCH_PARANOID} + , { "PLAYERS", SWITCH_PLAYERS} + , { "PORT", SWITCH_PORT} + , { "POSE", SWITCH_POSE} + , { "PRESERVE", SWITCH_PRESERVE} + , { "PRINT", SWITCH_PRINT} + , { "PRIVS", SWITCH_PRIVS} + , { "PURGE", SWITCH_PURGE} + , { "QUICK", SWITCH_QUICK} + , { "QUIET", SWITCH_QUIET} + , { "READ", SWITCH_READ} + , { "REBOOT", SWITCH_REBOOT} + , { "REGISTER", SWITCH_REGISTER} + , { "REMOVE", SWITCH_REMOVE} + , { "RENAME", SWITCH_RENAME} + , { "RESTORE", SWITCH_RESTORE} + , { "RESTRICT", SWITCH_RESTRICT} + , { "RETROACTIVE", SWITCH_RETROACTIVE} + , { "ROOM", SWITCH_ROOM} + , { "ROOMS", SWITCH_ROOMS} + , { "ROYALTY", SWITCH_ROYALTY} + , { "SEE", SWITCH_SEE} + , { "SEEFLAG", SWITCH_SEEFLAG} + , { "SELF", SWITCH_SELF} + , { "SEND", SWITCH_SEND} + , { "SET", SWITCH_SET} + , { "SILENT", SWITCH_SILENT} + , { "SKIPDEFAULTS", SWITCH_SKIPDEFAULTS} + , { "SPEAK", SWITCH_SPEAK} + , { "STATS", SWITCH_STATS} + , { "SUMMARY", SWITCH_SUMMARY} + , { "TABLES", SWITCH_TABLES} + , { "TAG", SWITCH_TAG} + , { "TELEPORT", SWITCH_TELEPORT} + , { "TF", SWITCH_TF} + , { "THINGS", SWITCH_THINGS} + , { "TITLE", SWITCH_TITLE} + , { "TRACE", SWITCH_TRACE} + , { "UNCLEAR", SWITCH_UNCLEAR} + , { "UNFOLDER", SWITCH_UNFOLDER} + , { "UNGAG", SWITCH_UNGAG} + , { "UNHIDE", SWITCH_UNHIDE} + , { "UNMUTE", SWITCH_UNMUTE} + , { "UNTAG", SWITCH_UNTAG} + , { "UNTIL", SWITCH_UNTIL} + , { "URGENT", SWITCH_URGENT} + , { "USEFLAG", SWITCH_USEFLAG} + , { "WHAT", SWITCH_WHAT} + , { "WIPE", SWITCH_WIPE} + , { "WIZ", SWITCH_WIZ} + , { "WIZARD", SWITCH_WIZARD} + , { "YES", SWITCH_YES} + , { "ZONE", SWITCH_ZONE} + , *** 1_7_4.82/src/strutil.c Fri, 23 Mar 2001 14:12:35 -0600 dunemush (pennmush/b/33_strutil.c 1.28.1.3.1.1 660) --- 1_7_4.93(w)/src/strutil.c Tue, 15 May 2001 15:58:44 -0500 dunemush (pennmush/b/33_strutil.c 1.28.1.3.1.3.1.1 660) *************** *** 38,43 **** --- 38,67 ---- char *next_token _((char *str, char sep)); static int format_long _((long val, char *buff, char **bp, int maxlen)); + + char * + mush_strdup(s, check) + const char *s; + const char *check; + { + char *x; + + #ifdef HAS_STRDUP + x = strdup(s); + #ifdef MEM_CHECK + if (x) + add_check(check); + #endif + #else + + Size_t len = strlen(s) + 1; + x = mush_malloc(len, check); + if (x) + memcpy(x, s, len); + #endif + return x; + } + /* Return the string chopped at lim characters */ char * chopstr(str, lim) *************** *** 598,614 **** p++; i++; } - i++; } else if (*p == TAG_START) { while ((*p) && (*p != TAG_END)) { p++; i++; } ! i++; ! } i++; p++; - numchars--; } return i; } --- 622,636 ---- p++; i++; } } else if (*p == TAG_START) { while ((*p) && (*p != TAG_END)) { p++; i++; } ! } else ! numchars--; i++; p++; } return i; } *************** *** 696,715 **** if (!orig) return NULL; ! for (q = (char *) orig; *q; q++) { switch (*q) { case ESC_CHAR: /* Skip over ansi */ ! while (*q && *q != 'm') ! q++; break; case TAG_START: /* Skip over HTML */ ! while (*q && *q != TAG_END) ! q++; break; default: ! safe_chr(*q, buff, &bp); } } *bp = '\0'; --- 718,735 ---- if (!orig) return NULL; ! for (q = (char *) orig; *q;) { switch (*q) { case ESC_CHAR: /* Skip over ansi */ ! while (*q && *q++ != 'm') ; break; case TAG_START: /* Skip over HTML */ ! while (*q && *q++ != TAG_END) ; break; default: ! safe_chr(*q++, buff, &bp); } } *bp = '\0'; *************** *** 814,817 **** --- 834,896 ---- } return 0; + } + + int + ansi_save(string, length, buff, bp) + const char *string; + int length; + char *buff, **bp; + { + const char *p; + int i = 0; + p = string; + if (!p) + return 0; + while (*p && (length != 0)) { + if (*p == ESC_CHAR) { + while ((*p) && (*p != 'm')) { + safe_chr(*p, buff, bp); + p++; + i++; + } + safe_chr(*p, buff, bp); + i++; + } else if (*p == TAG_START) { + while ((*p) && (*p != TAG_END)) { + safe_chr(*p, buff, bp); + p++; + i++; + } + safe_chr(*p, buff, bp); + i++; + } else if (length != -1) + length--; + i++; + p++; + } + safe_chr('\0', buff, bp); + return 1; + } + + int + ansi_align(string, length) + const char *string; + int length; + { + if (!string) + return length; + if ((Size_t) length > strlen(string)) + return strlen(string); + string += length; + for (; *string;) + if (*string == ESC_CHAR) + while ((*string) && (*string != 'm')) + ++string, ++length; + else if (*string == TAG_START) + while ((*string) && (*string != TAG_END)) + ++string, ++length; + else + break; + return length; } *** 1_7_4.82/src/speech.c Fri, 23 Mar 2001 14:12:35 -0600 dunemush (pennmush/b/35_speech.c 1.21.1.2.1.3.1.5.1.1.1.7 660) --- 1_7_4.93(w)/src/speech.c Tue, 15 May 2001 15:58:44 -0500 dunemush (pennmush/b/35_speech.c 1.21.1.2.1.3.1.5.1.1.1.7.1.3 660) *************** *** 69,75 **** return 1; if ((player != target) && (IsPlayer(target) && ! (Haven(target) || !eval_lock(player, target, Page_Lock)))) return 0; else return 1; } --- 69,76 ---- return 1; if ((player != target) && (IsPlayer(target) && ! (Haven(target) || !eval_lock(player, target, Page_Lock)))) ! return 0; else return 1; } *************** *** 888,896 **** if (Dark(target)) page_return(player, target, "Away", "AWAY", T("That player is not connected.")); ! } else if (!eval_lock(player, target, Page_Lock)) { ! page_return(player, target, "Haven", "HAVEN", ! T("That player is not accepting your pages.")); safe_chr(' ', tbuf, &tp); safe_str(current, tbuf, &tp); bcount++; --- 889,897 ---- if (Dark(target)) page_return(player, target, "Away", "AWAY", T("That player is not connected.")); ! else ! page_return(player, target, "Haven", "HAVEN", ! T("That player is not accepting your pages.")); safe_chr(' ', tbuf, &tp); safe_str(current, tbuf, &tp); bcount++; *************** *** 1073,1082 **** else safe_format(dest, &bp, "[%s:] ", spname(speaker)); *bp = '\0'; ! ret = strdup(dest); ! #ifdef MEM_CHECK ! add_check("string"); ! #endif return ret; } --- 1074,1080 ---- else safe_format(dest, &bp, "[%s:] ", spname(speaker)); *bp = '\0'; ! ret = mush_strdup(dest, "string"); return ret; } *** 1_7_4.82/src/set.c Sat, 07 Apr 2001 09:19:53 -0500 dunemush (pennmush/b/38_set.c 1.26 660) --- 1_7_4.93(w)/src/set.c Sun, 13 May 2001 08:36:12 -0500 dunemush (pennmush/b/38_set.c 1.26.1.1 660) *************** *** 694,707 **** safe_str(r, tbuf1, &tbufp); if (safe_format(tbuf_ansi, &tbufap, "%s%s%s%s", s, ANSI_HILITE, r, ! ANSI_NORMAL)) ansi_long_flag = 1; } else if (!strcmp(val, "^")) { /* prepend */ safe_str(r, tbuf1, &tbufp); safe_str(s, tbuf1, &tbufp); if (safe_format(tbuf_ansi, &tbufap, "%s%s%s%s", ANSI_HILITE, r, ANSI_NORMAL, ! s)) ansi_long_flag = 1; } else { /* find and replace */ char *p, *start = s; --- 694,709 ---- safe_str(r, tbuf1, &tbufp); if (safe_format(tbuf_ansi, &tbufap, "%s%s%s%s", s, ANSI_HILITE, r, ! ANSI_NORMAL)) ! ansi_long_flag = 1; } else if (!strcmp(val, "^")) { /* prepend */ safe_str(r, tbuf1, &tbufp); safe_str(s, tbuf1, &tbufp); if (safe_format(tbuf_ansi, &tbufap, "%s%s%s%s", ANSI_HILITE, r, ANSI_NORMAL, ! s)) ! ansi_long_flag = 1; } else { /* find and replace */ char *p, *start = s; *************** *** 734,740 **** } if (!ansi_long_flag) { if (safe_format(tbuf_ansi, &tbufap, "%s%s%s", ANSI_HILITE, r, ! ANSI_NORMAL)) ansi_long_flag = 1; } } /* No more val's in the string */ --- 736,743 ---- } if (!ansi_long_flag) { if (safe_format(tbuf_ansi, &tbufap, "%s%s%s", ANSI_HILITE, r, ! ANSI_NORMAL)) ! ansi_long_flag = 1; } } /* No more val's in the string */ *************** *** 853,860 **** /* if we pass the use key, do it */ ! if ( ! (thing = noisy_match_result(player, what, TYPE_THING, MAT_NEAR_THINGS)) != NOTHING) { if (!eval_lock(player, thing, Use_Lock)) { --- 856,862 ---- /* if we pass the use key, do it */ ! if ((thing = noisy_match_result(player, what, TYPE_THING, MAT_NEAR_THINGS)) != NOTHING) { if (!eval_lock(player, thing, Use_Lock)) { *** 1_7_4.82/src/services.c Fri, 17 Nov 2000 09:24:35 -0600 dunemush (pennmush/b/39_services.c 1.10 660) --- 1_7_4.93(w)/src/services.c Sun, 13 May 2001 08:36:12 -0500 dunemush (pennmush/b/39_services.c 1.11 660) *************** *** 612,625 **** Now create the service definition. */ ! service = ! CreateService(SCmanager, THIS_SERVICE, THIS_SERVICE_DISPLAY, ! SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, ! SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, fullfilename, NULL, /* no load ordering group */ ! NULL, /* no tag identifier */ ! NULL, /* no dependencies */ ! NULL, /* LocalSystem account */ ! NULL); /* no password */ if (!service) return service_error(GetLastError(), T("Unable to create service")); --- 612,622 ---- Now create the service definition. */ ! service = CreateService(SCmanager, THIS_SERVICE, THIS_SERVICE_DISPLAY, SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, fullfilename, NULL, /* no load ordering group */ ! NULL, /* no tag identifier */ ! NULL, /* no dependencies */ ! NULL, /* LocalSystem account */ ! NULL); /* no password */ if (!service) return service_error(GetLastError(), T("Unable to create service")); *** 1_7_4.82/src/rob.c Tue, 20 Mar 2001 12:21:04 -0600 dunemush (pennmush/b/42_rob.c 1.18.1.1 660) --- 1_7_4.93(w)/src/rob.c Sun, 13 May 2001 08:36:12 -0500 dunemush (pennmush/b/42_rob.c 1.18.1.2 660) *************** *** 22,28 **** void do_kill _((dbref player, const char *what, int cost, int slay)); ! void do_give _((dbref player, char *recipient, char *amnt)); void do_kill(player, what, cost, slay) --- 22,28 ---- void do_kill _((dbref player, const char *what, int cost, int slay)); ! void do_give _((dbref player, char *recipient, char *amnt, int silent)); void do_kill(player, what, cost, slay) *************** *** 122,131 **** } void ! do_give(player, recipient, amnt) dbref player; char *recipient; char *amnt; { dbref who; int amount; --- 122,132 ---- } void ! do_give(player, recipient, amnt, silent) dbref player; char *recipient; char *amnt; + int silent; { dbref who; int amount; *************** *** 264,270 **** ((abs(amount) == 1) ? MONEY : MONIES), Name(who))); } ! if (IsPlayer(who)) { if (amount > 0) { notify(who, tprintf(T("%s gives you %d %s."), Name(player), amount, ((amount == 1) ? MONEY : MONIES))); --- 265,271 ---- ((abs(amount) == 1) ? MONEY : MONIES), Name(who))); } ! if (IsPlayer(who) && !silent) { if (amount > 0) { notify(who, tprintf(T("%s gives you %d %s."), Name(player), amount, ((amount == 1) ? MONEY : MONIES))); *** 1_7_4.82/src/predicat.c Mon, 26 Mar 2001 15:33:20 -0600 dunemush (pennmush/b/44_predicat.c 1.1.1.34.1.1.1.3 660) --- 1_7_4.93(w)/src/predicat.c Sun, 13 May 2001 08:36:12 -0500 dunemush (pennmush/b/44_predicat.c 1.1.1.34.1.1.1.3.1.1 660) *************** *** 346,352 **** * 'look' 3) unconnected (sleeping) players aren't listed in a 'look' */ if (player == thing || IsExit(thing) || ! (IsPlayer(thing) && !Connected(thing))) return 0; /* if the room is lit, you can see any non-dark objects */ else if (can_see_loc) --- 346,353 ---- * 'look' 3) unconnected (sleeping) players aren't listed in a 'look' */ if (player == thing || IsExit(thing) || ! (IsPlayer(thing) && !Connected(thing))) ! return 0; /* if the room is lit, you can see any non-dark objects */ else if (can_see_loc) *************** *** 389,398 **** if ((Zone(what) != NOTHING) && (!IsPlayer(what)) && ! !Inheritable(what) && (eval_lock(who, Zone(what), Zone_Lock))) return 1; if (ZMaster(Owner(what)) && !IsPlayer(what) && ! (eval_lock(who, Owner(what), Zone_Lock))) return 1; return 0; } --- 390,401 ---- if ((Zone(what) != NOTHING) && (!IsPlayer(what)) && ! !Inheritable(what) && (eval_lock(who, Zone(what), Zone_Lock))) ! return 1; if (ZMaster(Owner(what)) && !IsPlayer(what) && ! (eval_lock(who, Owner(what), Zone_Lock))) ! return 1; return 0; } *************** *** 632,638 **** const char *scan, *good; if (!ok_name(name) || forbidden_name(name) || ! strlen(name) >= PLAYER_NAME_LIMIT) return 0; good = PLAYER_NAME_SPACES ? " `$_-.,'" : "`$_-.,'"; --- 635,642 ---- const char *scan, *good; if (!ok_name(name) || forbidden_name(name) || ! strlen(name) >= PLAYER_NAME_LIMIT) ! return 0; good = PLAYER_NAME_SPACES ? " `$_-.,'" : "`$_-.,'"; *************** *** 709,715 **** /* now try a wild card match of buff with stuff in coms */ for (a = 1; ! !(first && any) && (a < (MAX_ARG - 1)) && argv[a] && argv[a + 1]; a += 2) { /* eval expression */ ap = argv[a]; bp = buff; --- 713,720 ---- /* now try a wild card match of buff with stuff in coms */ for (a = 1; ! !(first && any) && (a < (MAX_ARG - 1)) && argv[a] && argv[a + 1]; ! a += 2) { /* eval expression */ ap = argv[a]; bp = buff; *************** *** 1081,1087 **** /* now we've got the object. match for it. */ if ((thing = noisy_match_result(player, obj, NOTYPE, MAT_EVERYTHING)) == ! NOTHING) return; if (!Can_Examine(player, thing)) { notify(player, T("Permission denied.")); return; --- 1086,1093 ---- /* now we've got the object. match for it. */ if ((thing = noisy_match_result(player, obj, NOTYPE, MAT_EVERYTHING)) == ! NOTHING) ! return; if (!Can_Examine(player, thing)) { notify(player, T("Permission denied.")); return; *** 1_7_4.82/src/player.c Thu, 05 Apr 2001 11:06:39 -0500 dunemush (pennmush/b/47_player.c 1.15.1.1.1.1 660) --- 1_7_4.93(w)/src/player.c Sun, 13 May 2001 08:36:12 -0500 dunemush (pennmush/b/47_player.c 1.15.1.1.1.1.1.1 660) *************** *** 396,402 **** #endif #endif #ifdef USE_MAILER ! (void) atr_add(player, "MAILCURF", "0", GOD, AF_LOCKED | AF_NOPROG | AF_WIZARD); add_folder_name(player, 0, "inbox"); #endif /* link him to PLAYER_START */ --- 396,403 ---- #endif #endif #ifdef USE_MAILER ! (void) atr_add(player, "MAILCURF", "0", GOD, ! AF_LOCKED | AF_NOPROG | AF_WIZARD); add_folder_name(player, 0, "inbox"); #endif /* link him to PLAYER_START */ *** 1_7_4.82/src/move.c Sat, 07 Apr 2001 13:33:48 -0500 dunemush (pennmush/b/51_move.c 1.1.1.18.1.5.1.13.1.3 660) --- 1_7_4.93(w)/src/move.c Sun, 13 May 2001 08:36:09 -0500 dunemush (pennmush/b/51_move.c 1.1.1.18.1.5.1.13.1.3.1.1 660) *************** *** 461,467 **** dbref loc; if ((thing = noisy_match_result(player, what, TYPE_EXIT, MAT_EXIT)) == ! NOTHING) return; loc = Home(thing); if (!controls(player, loc)) { --- 461,468 ---- dbref loc; if ((thing = noisy_match_result(player, what, TYPE_EXIT, MAT_EXIT)) == ! NOTHING) ! return; loc = Home(thing); if (!controls(player, loc)) { *************** *** 744,750 **** if (can_move(player, command)) do_move(player, command, 0); else if ((Zone(Location(player)) != NOTHING) && ! remote_exit(player, command)) do_move(player, command, 2); else if ((Location(player) != MASTER_ROOM) && global_exit(player, command)) do_move(player, command, 1); else --- 745,752 ---- if (can_move(player, command)) do_move(player, command, 0); else if ((Zone(Location(player)) != NOTHING) && ! remote_exit(player, command)) ! do_move(player, command, 2); else if ((Location(player) != MASTER_ROOM) && global_exit(player, command)) do_move(player, command, 1); else *************** *** 978,984 **** /* Let's take it apart and put it back together w/o follower */ strcpy(flwr, unparse_dbref(follower)); strcpy(tbuf1, uncompress(AL_STR(a))); ! (void) atr_add(leader, "FOLLOWERS", remove_word(tbuf1, flwr, ' '), GOD, NOTHING); } /* Delete someone from a player's FOLLOWING attribute */ --- 980,987 ---- /* Let's take it apart and put it back together w/o follower */ strcpy(flwr, unparse_dbref(follower)); strcpy(tbuf1, uncompress(AL_STR(a))); ! (void) atr_add(leader, "FOLLOWERS", remove_word(tbuf1, flwr, ' '), GOD, ! NOTHING); } /* Delete someone from a player's FOLLOWING attribute */ *************** *** 997,1003 **** /* Let's take it apart and put it back together w/o leader */ strcpy(ldr, unparse_dbref(leader)); strcpy(tbuf1, uncompress(AL_STR(a))); ! (void) atr_add(follower, "FOLLOWING", remove_word(tbuf1, ldr, ' '), GOD, NOTHING); } static void --- 1000,1007 ---- /* Let's take it apart and put it back together w/o leader */ strcpy(ldr, unparse_dbref(leader)); strcpy(tbuf1, uncompress(AL_STR(a))); ! (void) atr_add(follower, "FOLLOWING", remove_word(tbuf1, ldr, ' '), GOD, ! NOTHING); } static void *** 1_7_4.82/src/malias.c Sat, 07 Apr 2001 10:14:58 -0500 dunemush (pennmush/c/3_malias.c 1.29 660) --- 1_7_4.93(w)/src/malias.c Tue, 15 May 2001 15:58:44 -0500 dunemush (pennmush/c/3_malias.c 1.30 660) *************** *** 57,64 **** #include "mymalloc.h" #include "flags.h" #include "pueblo.h" - #include "confmagic.h" #include "log.h" #ifdef MAIL_ALIASES --- 57,68 ---- #include "mymalloc.h" #include "flags.h" #include "pueblo.h" #include "log.h" + #ifdef MEM_CHECK + #include "memcheck.h" + #endif + #include "confmagic.h" + #ifdef MAIL_ALIASES *************** *** 154,167 **** ma_size = MA_INC; malias = (struct mail_alias *) mush_malloc(sizeof(struct mail_alias) * ! ma_size, "malias"); } else if (ma_top >= ma_size) { ma_size += MA_INC; m = (struct mail_alias *) mush_malloc(sizeof(struct mail_alias) * ! (ma_size), "malias"); memcpy(m, malias, sizeof(struct mail_alias) * ma_top); ! mush_free((Malloc_t) malias, "malias"); malias = m; } i = 0; --- 158,171 ---- ma_size = MA_INC; malias = (struct mail_alias *) mush_malloc(sizeof(struct mail_alias) * ! ma_size, "malias_list"); } else if (ma_top >= ma_size) { ma_size += MA_INC; m = (struct mail_alias *) mush_malloc(sizeof(struct mail_alias) * ! (ma_size), "malias_list"); memcpy(m, malias, sizeof(struct mail_alias) * ma_top); ! mush_free((Malloc_t) malias, "malias_list"); malias = m; } i = 0; *************** *** 225,238 **** return; } m = &malias[ma_top]; ! m->members = (dbref *) mush_malloc(sizeof(dbref) * i, "malias"); memcpy(m->members, alist, sizeof(dbref) * i); na = alias + 1; m->size = i; m->owner = player; ! m->name = u_strdup(na); m->desc = u_strdup(compress(na)); m->nflags = ALIAS_OWNER | ALIAS_MEMBERS; m->mflags = ALIAS_OWNER; ma_top++; --- 229,245 ---- return; } m = &malias[ma_top]; ! m->members = (dbref *) mush_malloc(sizeof(dbref) * i, "malias_members"); memcpy(m->members, alist, sizeof(dbref) * i); na = alias + 1; m->size = i; m->owner = player; ! m->name = mush_strdup(na, "malias_name"); m->desc = u_strdup(compress(na)); + #ifdef MEM_CHECK + add_check("malias_desc"); + #endif m->nflags = ALIAS_OWNER | ALIAS_MEMBERS; m->mflags = ALIAS_OWNER; ma_top++; *************** *** 321,327 **** notify(player, tprintf(T("MAIL: Alias %s not found."), alias)); return; } else if (Wizard(player) || (player == m->owner)) { ! free(m->desc); m->desc = u_strdup(compress(desc)); notify(player, T("MAIL: Description changed.")); } else --- 328,335 ---- notify(player, tprintf(T("MAIL: Alias %s not found."), alias)); return; } else if (Wizard(player) || (player == m->owner)) { ! if (m->desc) ! free(m->desc); /* No need to update MEM_CHECK records here */ m->desc = u_strdup(compress(desc)); notify(player, T("MAIL: Description changed.")); } else *************** *** 385,392 **** notify(player, T("MAIL: Permission denied.")); return; } ! free(m->name); ! m->name = u_strdup(newname + 1); notify(player, T("MAIL: Mail Alias renamed.")); } --- 393,401 ---- notify(player, T("MAIL: Permission denied.")); return; } ! ! free(m->name); /* No need to update MEM_CHECK records here. */ ! m->name = strdup(newname + 1); notify(player, T("MAIL: Mail Alias renamed.")); } *************** *** 409,415 **** if (Wizard(player) || (m->owner == player)) { notify(player, T("MAIL: Alias Destroyed.")); if (m->members) ! mush_free((Malloc_t) m->members, "malias"); *m = malias[--ma_top]; } else { notify(player, T("MAIL: Permission denied!")); --- 418,428 ---- if (Wizard(player) || (m->owner == player)) { notify(player, T("MAIL: Alias Destroyed.")); if (m->members) ! mush_free((Malloc_t) m->members, "malias_members"); ! if (m->name) ! mush_free(m->name, "malias_name"); ! if (m->desc) ! mush_free(m->desc, "malias_desc"); *m = malias[--ma_top]; } else { notify(player, T("MAIL: Permission denied!")); *************** *** 506,513 **** return; } if (m->members) ! mush_free((Malloc_t) m->members, "malias"); ! m->members = (dbref *) mush_malloc(sizeof(dbref) * i, "malias"); memcpy(m->members, alist, sizeof(dbref) * i); m->size = i; notify(player, T("MAIL: Alias list set.")); --- 519,526 ---- return; } if (m->members) ! mush_free((Malloc_t) m->members, "malias_members"); ! m->members = (dbref *) mush_malloc(sizeof(dbref) * i, "malias_members"); memcpy(m->members, alist, sizeof(dbref) * i); m->size = i; notify(player, T("MAIL: Alias list set.")); *************** *** 571,583 **** for (i = 0; i < ma_top; i++) { m = &malias[i]; if (m->name) ! free(m->name); if (m->desc) ! free(m->desc); if (m->members) ! mush_free((Malloc_t) m->members, "malias"); } ! mush_free((Malloc_t) malias, "malias"); } ma_size = ma_top = 0; notify(player, T("MAIL: All mail aliases destroyed!")); --- 584,596 ---- for (i = 0; i < ma_top; i++) { m = &malias[i]; if (m->name) ! mush_free(m->name, "malias_name"); if (m->desc) ! mush_free(m->desc, "malias_desc"); if (m->members) ! mush_free((Malloc_t) m->members, "malias_members"); } ! mush_free((Malloc_t) malias, "malias_list"); } ma_size = ma_top = 0; notify(player, T("MAIL: All mail aliases destroyed!")); *************** *** 772,782 **** notify(player, T("MAIL: No valid recipients for alias-list!")); return; } ! members = (dbref *) mush_malloc(sizeof(dbref) * (i + m->size), "malias"); memcpy(members, m->members, sizeof(dbref) * m->size); memcpy(&members[m->size], alist, sizeof(dbref) * i); ! mush_free((Malloc_t) m->members, "malias"); m->members = members; m->size += i; --- 785,795 ---- notify(player, T("MAIL: No valid recipients for alias-list!")); return; } ! members = (dbref *) mush_malloc(sizeof(dbref) * (i + m->size), "malias_members"); memcpy(members, m->members, sizeof(dbref) * m->size); memcpy(&members[m->size], alist, sizeof(dbref) * i); ! mush_free((Malloc_t) m->members, "malias_members"); m->members = members; m->size += i; *************** *** 1033,1039 **** if (ma_top > 0) malias = (struct mail_alias *) mush_malloc(sizeof(struct mail_alias) * ! ma_size, "malias"); else malias = NULL; --- 1046,1052 ---- if (ma_top > 0) malias = (struct mail_alias *) mush_malloc(sizeof(struct mail_alias) * ! ma_size, "malias_list"); else malias = NULL; *************** *** 1041,1055 **** m = &malias[i]; m->owner = getref(fp); ! m->name = u_strdup(getstring_noalloc(fp)); m->desc = u_strdup(compress(getstring_noalloc(fp))); m->nflags = getref(fp); m->mflags = getref(fp); m->size = getref(fp); if (m->size > 0) { ! m->members = (dbref *) mush_malloc(m->size * sizeof(dbref), "malias"); for (j = 0; j < m->size; j++) { m->members[j] = getref(fp); } --- 1054,1071 ---- m = &malias[i]; m->owner = getref(fp); ! m->name = mush_strdup(getstring_noalloc(fp), "malias_name"); m->desc = u_strdup(compress(getstring_noalloc(fp))); + #ifdef MEM_CHECK + add_check("malias_desc"); + #endif m->nflags = getref(fp); m->mflags = getref(fp); m->size = getref(fp); if (m->size > 0) { ! m->members = (dbref *) mush_malloc(m->size * sizeof(dbref), "malias_members"); for (j = 0; j < m->size; j++) { m->members[j] = getref(fp); } *** 1_7_4.82/src/look.c Mon, 11 Dec 2000 20:10:38 -0600 dunemush (pennmush/c/4_look.c 1.21 660) --- 1_7_4.93(w)/src/look.c Sun, 13 May 2001 08:36:09 -0500 dunemush (pennmush/c/4_look.c 1.21.1.1 660) *************** *** 649,658 **** } real_name = (char *) name; /* look it up */ ! if ( ! (thing = noisy_match_result(player, real_name, NOTYPE, ! MAT_EVERYTHING)) == NOTHING) return; } /* can't examine destructed objects */ if (IsGarbage(thing)) { --- 649,658 ---- } real_name = (char *) name; /* look it up */ ! if ((thing = noisy_match_result(player, real_name, NOTYPE, ! MAT_EVERYTHING)) == NOTHING) ! return; } /* can't examine destructed objects */ if (IsGarbage(thing)) { *************** *** 1302,1308 **** /* find object */ if ((thing = noisy_match_result(player, name, NOTYPE, MAT_EVERYTHING)) == ! NOTHING) return; if (IsGarbage(thing)) { notify(player, T("Garbage is garbage.")); --- 1302,1309 ---- /* find object */ if ((thing = noisy_match_result(player, name, NOTYPE, MAT_EVERYTHING)) == ! NOTHING) ! return; if (IsGarbage(thing)) { notify(player, T("Garbage is garbage.")); *** 1_7_4.82/src/gmalloc.c Thu, 20 Jul 2000 17:42:54 -0500 dunemush (pennmush/c/9_gmalloc.c 1.19 660) --- 1_7_4.93(w)/src/gmalloc.c Sun, 13 May 2001 08:36:08 -0500 dunemush (pennmush/c/9_gmalloc.c 1.20 660) *************** *** 289,295 **** #ifdef __cplusplus } #endif ! #endif /* malloc.h */ /* Allocate memory on a page boundary. Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc. This library is free software; you can redistribute it and/or --- 289,295 ---- #ifdef __cplusplus } #endif ! #endif /* malloc.h */ /* Allocate memory on a page boundary. Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc. This library is free software; you can redistribute it and/or *** 1_7_4.82/src/game.c Wed, 04 Apr 2001 12:03:23 -0500 dunemush (pennmush/c/10_game.c 1.50.1.8.1.1.1.1.2.1 660) --- 1_7_4.93(w)/src/game.c Sun, 13 May 2001 08:36:08 -0500 dunemush (pennmush/c/10_game.c 1.50.1.8.1.1.1.1.2.1.1.1 660) *************** *** 131,141 **** void rusage_stats _((void)); #endif ! void do_list_memstats _((dbref player)); ! void st_stats_header _((dbref player)); ! void st_stats _((dbref player, StrTree *root, const char *name)); ! ! extern void do_reboot _((dbref player, int flag)); dbref orator = NOTHING; --- 131,143 ---- void rusage_stats _((void)); #endif ! void do_list_memstats(dbref player); ! void st_stats_header(dbref player); ! void st_stats(dbref player, StrTree *root, const char *name); ! ! void do_reboot(dbref player, int flag); ! void do_timestring(char *buff, char **bp, const char *format, ! unsigned long secs); dbref orator = NOTHING; *************** *** 547,555 **** #ifndef WIN32 close(reserved); /* get that file descriptor back */ #endif - #ifdef CONCENTRATOR - signal(SIGCLD, SIG_DFL); - #endif /* CONCENTRATOR */ dump_database_internal(); if (!nofork) { _exit(0); /* !!! */ --- 549,554 ---- *************** *** 557,565 **** #ifndef WIN32 reserved = open("/dev/null", O_RDWR); #endif - #ifdef CONCENTRATOR - signal(SIGCLD, (void *) reaper); - #endif /* CONCENTRATOR */ if (DUMP_NOFORK_COMPLETE && *DUMP_NOFORK_COMPLETE) flag_broadcast(0, 0, DUMP_NOFORK_COMPLETE); } --- 556,561 ---- *************** *** 1498,1511 **** } void ! do_uptime(player, mortal) ! dbref player; ! int mortal; { char tbuf1[BUFFER_LEN]; char *p; ! #ifdef HAS_UPTIME FILE *fp; char c; int i; --- 1494,1505 ---- } void ! do_uptime(dbref player, int mortal) { char tbuf1[BUFFER_LEN]; char *p; ! #if defined(HAS_UPTIME) && !defined(linux) FILE *fp; char c; int i; *************** *** 1516,1522 **** struct rusage usage; #endif /* HAS_GETRUSAGE */ #ifdef linux ! FILE *status; char line[128]; /* Overkill */ char *nl; #endif --- 1510,1516 ---- struct rusage usage; #endif /* HAS_GETRUSAGE */ #ifdef linux ! FILE *fp; char line[128]; /* Overkill */ char *nl; #endif *************** *** 1563,1568 **** --- 1557,1621 ---- /* Mortals, go no further! */ if (!Wizard(player) || mortal) return; + #ifdef linux + /* Use /proc files instead of calling the external uptime program on linux */ + + /* Current time */ + { + struct tm *t; + t = localtime(&mudtime); + + strftime(tbuf1, sizeof tbuf1, "%I:%M%P ", t); + nl = tbuf1 + strlen(tbuf1); + } + /* System uptime */ + fp = fopen("/proc/uptime", "r"); + if (fp) { + time_t uptime; + const char *fmt; + if (fgets(line, sizeof line, fp)) { + /* First part of this line is uptime in seconds.milliseconds. We + only care about seconds. */ + uptime = strtol(line, NULL, 10); + if (uptime > 86400) + fmt = "up $d days, $2h:$2M,"; + else + fmt = "up $2h:$2M,"; + do_timestring(tbuf1, &nl, fmt, uptime); + } else { + safe_str("Unknown uptime,", tbuf1, &nl); + } + fclose(fp); + } else { + safe_str("Unknown uptime,", tbuf1, &nl); + } + + /* Now load averages */ + fp = fopen("/proc/loadavg", "r"); + if (fp) { + if (fgets(line, sizeof line, fp)) { + double load[3]; + char *x, *l = line; + + load[0] = strtod(l, &x); + l = x; + load[1] = strtod(l, &x); + l = x; + load[2] = strtod(l, NULL); + safe_format(tbuf1, &nl, " load average: %.2f, %.2f, %.2f", + load[0], load[1], load[2]); + } else { + safe_str("Unknown load", tbuf1, &nl); + } + fclose(fp); + } else { + safe_str("Unknown load", tbuf1, &nl); + } + + *nl = '\0'; + notify(player, tbuf1); + + #else /* linux */ #ifdef HAS_UPTIME fp = #ifdef __LCC__ *************** *** 1583,1589 **** pclose(fp); notify(player, tbuf1); ! #endif /* do process stats */ --- 1636,1643 ---- pclose(fp); notify(player, tbuf1); ! #endif /* HAS_UPTIME */ ! #endif /* !linux */ /* do process stats */ *************** *** 1605,1626 **** usage.ru_majflt, usage.ru_minflt, usage.ru_nswap)); #endif ! status = fopen("/proc/self/status", "r"); ! if (!status) return; /* First lines are name, state, pid, ppid and some other stuff. We don't care about them */ ! fgets(line, sizeof line, status); ! fgets(line, sizeof line, status); ! fgets(line, sizeof line, status); ! fgets(line, sizeof line, status); ! fgets(line, sizeof line, status); ! fgets(line, sizeof line, status); ! fgets(line, sizeof line, status); /* 7th line isn't Groups: on linux 2.0.X */ if (strncmp(line, "Groups:", 7) == 0) ! fgets(line, sizeof line, status); /* Memory stats */ --- 1659,1680 ---- usage.ru_majflt, usage.ru_minflt, usage.ru_nswap)); #endif ! fp = fopen("/proc/self/status", "r"); ! if (!fp) return; /* First lines are name, state, pid, ppid and some other stuff. We don't care about them */ ! fgets(line, sizeof line, fp); ! fgets(line, sizeof line, fp); ! fgets(line, sizeof line, fp); ! fgets(line, sizeof line, fp); ! fgets(line, sizeof line, fp); ! fgets(line, sizeof line, fp); ! fgets(line, sizeof line, fp); /* 7th line isn't Groups: on linux 2.0.X */ if (strncmp(line, "Groups:", 7) == 0) ! fgets(line, sizeof line, fp); /* Memory stats */ *************** *** 1630,1697 **** notify(player, line); /* VmLck */ ! fgets(line, sizeof line, status); if ((nl = strchr(line, '\n')) != NULL) *nl = '\0'; notify(player, line); /* VmRSS */ ! fgets(line, sizeof line, status); if ((nl = strchr(line, '\n')) != NULL) *nl = '\0'; notify(player, line); /* VmData */ ! fgets(line, sizeof line, status); if ((nl = strchr(line, '\n')) != NULL) *nl = '\0'; notify(player, line); /* VmStk */ ! fgets(line, sizeof line, status); if ((nl = strchr(line, '\n')) != NULL) *nl = '\0'; notify(player, line); /* VmExe */ ! fgets(line, sizeof line, status); if ((nl = strchr(line, '\n')) != NULL) *nl = '\0'; notify(player, line); /* VmLib */ ! fgets(line, sizeof line, status); if ((nl = strchr(line, '\n')) != NULL) *nl = '\0'; notify(player, line); /* Signals */ /* SigPnd */ ! fgets(line, sizeof line, status); if ((nl = strchr(line, '\n')) != NULL) *nl = '\0'; notify(player, line); /* SigBlk */ ! fgets(line, sizeof line, status); if ((nl = strchr(line, '\n')) != NULL) *nl = '\0'; notify(player, line); /* SigIgn */ ! fgets(line, sizeof line, status); if ((nl = strchr(line, '\n')) != NULL) *nl = '\0'; notify(player, line); /* SigCgt */ ! fgets(line, sizeof line, status); if ((nl = strchr(line, '\n')) != NULL) *nl = '\0'; notify(player, line); ! /* We don't have about capabilities */ ! fclose(status); #else /* LINUX */ #ifdef HAS_GETRUSAGE --- 1684,1751 ---- notify(player, line); /* VmLck */ ! fgets(line, sizeof line, fp); if ((nl = strchr(line, '\n')) != NULL) *nl = '\0'; notify(player, line); /* VmRSS */ ! fgets(line, sizeof line, fp); if ((nl = strchr(line, '\n')) != NULL) *nl = '\0'; notify(player, line); /* VmData */ ! fgets(line, sizeof line, fp); if ((nl = strchr(line, '\n')) != NULL) *nl = '\0'; notify(player, line); /* VmStk */ ! fgets(line, sizeof line, fp); if ((nl = strchr(line, '\n')) != NULL) *nl = '\0'; notify(player, line); /* VmExe */ ! fgets(line, sizeof line, fp); if ((nl = strchr(line, '\n')) != NULL) *nl = '\0'; notify(player, line); /* VmLib */ ! fgets(line, sizeof line, fp); if ((nl = strchr(line, '\n')) != NULL) *nl = '\0'; notify(player, line); /* Signals */ /* SigPnd */ ! fgets(line, sizeof line, fp); if ((nl = strchr(line, '\n')) != NULL) *nl = '\0'; notify(player, line); /* SigBlk */ ! fgets(line, sizeof line, fp); if ((nl = strchr(line, '\n')) != NULL) *nl = '\0'; notify(player, line); /* SigIgn */ ! fgets(line, sizeof line, fp); if ((nl = strchr(line, '\n')) != NULL) *nl = '\0'; notify(player, line); /* SigCgt */ ! fgets(line, sizeof line, fp); if ((nl = strchr(line, '\n')) != NULL) *nl = '\0'; notify(player, line); ! /* We don't care about capabilities */ ! fclose(fp); #else /* LINUX */ #ifdef HAS_GETRUSAGE *** 1_7_4.82/src/funtime.c Sun, 25 Feb 2001 13:37:15 -0600 dunemush (pennmush/c/12_funtime.c 1.11.1.2 660) --- 1_7_4.93(w)/src/funtime.c Sun, 13 May 2001 08:36:08 -0500 dunemush (pennmush/c/12_funtime.c 1.11.1.3 660) *************** *** 19,27 **** #include "log.h" #include "confmagic.h" ! int do_convtime _((char *str, struct tm * ttm)); ! static void do_timestring ! _((char *buff, char **bp, const char *format, unsigned long secs)); FUNCTION(fun_timefmt) { --- 19,27 ---- #include "log.h" #include "confmagic.h" ! int do_convtime(char *str, struct tm *ttm); ! void do_timestring(char *buff, char **bp, const char *format, ! unsigned long secs); FUNCTION(fun_timefmt) { *************** *** 353,363 **** $$ - Literal $. */ void ! do_timestring(buff, bp, format, secs) ! char *buff; ! char **bp; ! const char *format; ! unsigned long secs; { int days, hours, mins; int pad = 0; --- 353,359 ---- $$ - Literal $. */ void ! do_timestring(char *buff, char **bp, const char *format, unsigned long secs) { int days, hours, mins; int pad = 0; *** 1_7_4.82/src/funstr.c Mon, 26 Mar 2001 15:33:20 -0600 dunemush (pennmush/c/13_funstr.c 1.28.1.1.1.2.1.2 660) --- 1_7_4.93(w)/src/funstr.c Sun, 13 May 2001 08:36:08 -0500 dunemush (pennmush/c/13_funstr.c 1.28.1.1.1.2.1.4 660) *************** *** 199,210 **** /* ARGSUSED */ FUNCTION(fun_strlen) { ! safe_integer(strlen(args[0]), buff, bp); } /* ARGSUSED */ FUNCTION(fun_mid) { int pos, len; if (!is_integer(args[1]) || !is_integer(args[2])) { --- 199,211 ---- /* ARGSUSED */ FUNCTION(fun_strlen) { ! safe_integer(ansi_strlen(args[0]), buff, bp); } /* ARGSUSED */ FUNCTION(fun_mid) { + char ansi_buff[BUFFER_LEN], *ansi_bp = ansi_buff; int pos, len; if (!is_integer(args[1]) || !is_integer(args[2])) { *************** *** 212,218 **** return; } pos = parse_integer(args[1]); ! len = parse_integer(args[2]); /* There was an error for pos + len > BUFFER_LEN, but I removed it. * After all, why should the behavior for past-end-of-string --- 213,220 ---- return; } pos = parse_integer(args[1]); ! len = ! ansi_align(args[0], ansi_strnlen(args[0], pos + parse_integer(args[2]))); /* There was an error for pos + len > BUFFER_LEN, but I removed it. * After all, why should the behavior for past-end-of-string *************** *** 222,237 **** safe_str(T(e_range), buff, bp); return; } ! if (((pos + len) < BUFFER_LEN) && ((pos + len) >= 0)) ! args[0][pos + len] = '\0'; ! if ((Size_t) pos < strlen(args[0])) safe_str(args[0] + pos, buff, bp); } /* ARGSUSED */ FUNCTION(fun_left) { int len; if (!is_integer(args[1])) { --- 224,255 ---- safe_str(T(e_range), buff, bp); return; } ! ! /* Write the initial ANSI/Pueblo bits */ ! ansi_save(args[0], pos, ansi_buff, &ansi_bp); ! safe_str(ansi_buff, buff, bp); ! pos = ansi_align(args[0], ansi_strnlen(args[0], pos)); ! ansi_bp = ansi_buff; ! ! if ((((Size_t) len) < strlen(args[0])) && ((len) >= 0)) { ! /* Save the ending ANSI/Pueblo bits */ ! ansi_save(args[0] + len, -1, ansi_buff, &ansi_bp); ! } ! if (((len) < BUFFER_LEN) && ((len) >= 0)) { ! args[0][len] = '\0'; ! } ! if ((Size_t) pos < strlen(args[0])) { safe_str(args[0] + pos, buff, bp); + } + if (ansi_bp != ansi_buff) + safe_str(ansi_buff, buff, bp); } /* ARGSUSED */ FUNCTION(fun_left) { + char ansi_buff[BUFFER_LEN], *ansi_bp = ansi_buff; int len; if (!is_integer(args[1])) { *************** *** 244,257 **** --- 262,281 ---- safe_str(T(e_range), buff, bp); return; } + + len = ansi_strnlen(args[0], len); + ansi_save(args[0] + len - 1, -1, ansi_buff, &ansi_bp); + len = ansi_align(args[0], len); if (len < BUFFER_LEN) args[0][len] = '\0'; safe_str(args[0], buff, bp); + safe_str(ansi_buff, buff, bp); } /* ARGSUSED */ FUNCTION(fun_right) { + char ansi_buff[BUFFER_LEN], *ansi_bp = ansi_buff; int len; if (!is_integer(args[1])) { *************** *** 264,274 **** safe_str(T(e_range), buff, bp); return; } ! len = strlen(args[0]) - len; if (len <= 0) { safe_str(args[0], buff, bp); return; } safe_str(args[0] + len, buff, bp); } --- 288,302 ---- safe_str(T(e_range), buff, bp); return; } ! len = ansi_strlen(args[0]) - len; if (len <= 0) { safe_str(args[0], buff, bp); return; } + ansi_save(args[0], len, ansi_buff, &ansi_bp); + len = ansi_strnlen(args[0], len); + len = ansi_align(args[0], len); + safe_str(ansi_buff, buff, bp); safe_str(args[0] + len, buff, bp); } *************** *** 950,961 **** safe_tag_wrap(args[0], args[1], args[2], buff, bp); } /* ARGSUSED */ FUNCTION(fun_ansi) { ! static char tbuff[BUFFER_LEN], slots[7]; ! static char sbuff[BUFFER_LEN], *sbp = sbuff; ! char *old_sbp = sbp; char const *arg0, *arg1; char *tbp; int j; --- 978,1075 ---- safe_tag_wrap(args[0], args[1], args[2], buff, bp); } + #define COL_FLASH (1) + #define COL_HILITE (2) + #define COL_INVERT (4) + #define COL_UNDERSCORE (8) + + #define VAL_FLASH (5) + #define VAL_HILITE (1) + #define VAL_INVERT (7) + #define VAL_UNDERSCORE (4) + + #define COL_BLACK (30) + #define COL_RED (31) + #define COL_GREEN (32) + #define COL_YELLOW (33) + #define COL_BLUE (34) + #define COL_MAGENTA (35) + #define COL_CYAN (36) + #define COL_WHITE (37) + + typedef struct { + char flags; + char fore; + char back; + } ansi_data; + + #define EDGE_UP(x,y,z) (((y) & (z)) && !((x) & (z))) + + static void + dump_ansi_codes(ad, buff, bp) + ansi_data *ad; + char *buff; + char **bp; + { + ansi_data old_ad; + int f = 0; + + if ((old_ad.fore && !ad->fore) + || (old_ad.back && !ad->back) + || ((old_ad.flags & ad->flags) != old_ad.flags)) { + safe_str(ANSI_NORMAL, buff, bp); + old_ad.flags = 0; + old_ad.fore = 0; + old_ad.back = 0; + } + + safe_str(ANSI_BEGIN, buff, bp); + + if (EDGE_UP(old_ad.flags, ad->flags, COL_FLASH)) { + if (f++) + safe_chr(';', buff, bp); + safe_integer(VAL_FLASH, buff, bp); + } + + if (EDGE_UP(old_ad.flags, ad->flags, COL_HILITE)) { + if (f++) + safe_chr(';', buff, bp); + safe_integer(VAL_HILITE, buff, bp); + } + + if (EDGE_UP(old_ad.flags, ad->flags, COL_INVERT)) { + if (f++) + safe_chr(';', buff, bp); + safe_integer(VAL_INVERT, buff, bp); + } + + if (EDGE_UP(old_ad.flags, ad->flags, COL_UNDERSCORE)) { + if (f++) + safe_chr(';', buff, bp); + safe_integer(VAL_UNDERSCORE, buff, bp); + } + + if (ad->fore != old_ad.fore) { + if (f++) + safe_chr(';', buff, bp); + safe_integer(ad->fore, buff, bp); + } + + if (ad->back != old_ad.back) { + if (f++) + safe_chr(';', buff, bp); + safe_integer(ad->back + 10, buff, bp); + } + + safe_str(ANSI_END, buff, bp); + + } + /* ARGSUSED */ FUNCTION(fun_ansi) { ! static char tbuff[BUFFER_LEN]; ! static ansi_data stack[1024] = { {0, 0, 0} }, *sp = stack; char const *arg0, *arg1; char *tbp; int j; *************** *** 966,1093 **** PE_DEFAULT, PT_DEFAULT, pe_info); *tbp = '\0'; ! memset(slots, '\0', 7); for (tbp = tbuff; *tbp; tbp++) { switch (*tbp) { case 'n': /* normal */ ! memset(slots, '\0', 6); ! slots[0] = *tbp; break; case 'f': /* flash */ ! slots[1] = *tbp; break; case 'h': /* hilite */ ! slots[2] = *tbp; break; case 'i': /* inverse */ ! slots[3] = *tbp; break; case 'u': /* underscore */ ! slots[4] = *tbp; break; ! case 'b': /* blue fg */ ! case 'c': /* cyan fg */ ! case 'g': /* green fg */ ! case 'm': /* magenta fg */ ! case 'r': /* red fg */ ! case 'w': /* white fg */ ! case 'x': /* black fg */ ! case 'y': /* yellow fg */ ! slots[5] = *tbp; break; ! case 'B': /* blue bg */ ! case 'C': /* cyan bg */ ! case 'G': /* green bg */ ! case 'M': /* magenta bg */ ! case 'R': /* red bg */ ! case 'W': /* white bg */ ! case 'X': /* black bg */ ! case 'Y': /* yellow bg */ ! slots[6] = *tbp; break; ! } ! } ! ! for (j = 0; j < 7; j++) { ! switch (slots[j]) { ! case 'n': /* normal */ ! safe_str(ANSI_NORMAL, sbuff, &sbp); break; ! case 'f': /* flash */ ! safe_str(ANSI_BLINK, sbuff, &sbp); ! break; ! case 'h': /* hilite */ ! safe_str(ANSI_HILITE, sbuff, &sbp); break; ! case 'i': /* inverse */ ! safe_str(ANSI_INVERSE, sbuff, &sbp); ! break; ! case 'u': /* underscore */ ! safe_str(ANSI_UNDERSCORE, sbuff, &sbp); ! break; ! case 'x': /* black fg */ ! safe_str(ANSI_BLACK, sbuff, &sbp); break; ! case 'r': /* red fg */ ! safe_str(ANSI_RED, sbuff, &sbp); break; case 'g': /* green fg */ ! safe_str(ANSI_GREEN, sbuff, &sbp); ! break; ! case 'y': /* yellow fg */ ! safe_str(ANSI_YELLOW, sbuff, &sbp); ! break; ! case 'b': /* blue fg */ ! safe_str(ANSI_BLUE, sbuff, &sbp); break; case 'm': /* magenta fg */ ! safe_str(ANSI_MAGENTA, sbuff, &sbp); break; ! case 'c': /* cyan fg */ ! safe_str(ANSI_CYAN, sbuff, &sbp); break; case 'w': /* white fg */ ! safe_str(ANSI_WHITE, sbuff, &sbp); break; ! case 'X': /* black bg */ ! safe_str(ANSI_BBLACK, sbuff, &sbp); break; ! case 'R': /* red bg */ ! safe_str(ANSI_BRED, sbuff, &sbp); break; ! case 'G': /* green bg */ ! safe_str(ANSI_BGREEN, sbuff, &sbp); break; ! case 'Y': /* yellow bg */ ! safe_str(ANSI_BYELLOW, sbuff, &sbp); break; ! case 'B': /* blue bg */ ! safe_str(ANSI_BBLUE, sbuff, &sbp); break; case 'M': /* magenta bg */ ! safe_str(ANSI_BMAGENTA, sbuff, &sbp); break; ! case 'C': /* cyan bg */ ! safe_str(ANSI_BCYAN, sbuff, &sbp); break; case 'W': /* white bg */ ! safe_str(ANSI_BWHITE, sbuff, &sbp); break; } } ! *sbp = 0; ! safe_str(old_sbp, buff, bp); arg1 = args[1]; process_expression(buff, bp, &arg1, executor, caller, enactor, PE_DEFAULT, PT_DEFAULT, pe_info); ! safe_str(ANSI_NORMAL, buff, bp); - sbp = old_sbp; - *sbp = 0; - safe_str(sbuff, buff, bp); } /* ARGSUSED */ --- 1080,1178 ---- PE_DEFAULT, PT_DEFAULT, pe_info); *tbp = '\0'; ! sp[1] = sp[0]; ! sp++; for (tbp = tbuff; *tbp; tbp++) { switch (*tbp) { case 'n': /* normal */ ! sp->flags = 0; ! sp->fore = 0; ! sp->back = 0; break; case 'f': /* flash */ ! sp->flags |= COL_FLASH; break; case 'h': /* hilite */ ! sp->flags |= COL_HILITE; break; case 'i': /* inverse */ ! sp->flags |= COL_INVERT; break; case 'u': /* underscore */ ! sp->flags |= COL_UNDERSCORE; break; ! case 'F': /* flash */ ! sp->flags &= ~COL_FLASH; break; ! case 'H': /* hilite */ ! sp->flags &= ~COL_HILITE; break; ! case 'I': /* inverse */ ! sp->flags &= ~COL_INVERT; break; ! case 'U': /* underscore */ ! sp->flags &= ~COL_UNDERSCORE; break; ! case 'b': /* blue fg */ ! sp->fore = COL_BLUE; break; ! case 'c': /* cyan fg */ ! sp->fore = COL_CYAN; break; case 'g': /* green fg */ ! sp->fore = COL_GREEN; break; case 'm': /* magenta fg */ ! sp->fore = COL_MAGENTA; break; ! case 'r': /* red fg */ ! sp->fore = COL_RED; break; case 'w': /* white fg */ ! sp->fore = COL_WHITE; break; ! case 'x': /* black fg */ ! sp->fore = COL_BLACK; break; ! case 'y': /* yellow fg */ ! sp->fore = COL_YELLOW; break; ! case 'B': /* blue bg */ ! sp->back = COL_BLUE; break; ! case 'C': /* cyan bg */ ! sp->back = COL_CYAN; break; ! case 'G': /* green bg */ ! sp->back = COL_GREEN; break; case 'M': /* magenta bg */ ! sp->back = COL_MAGENTA; break; ! case 'R': /* red bg */ ! sp->back = COL_RED; break; case 'W': /* white bg */ ! sp->back = COL_WHITE; ! break; ! case 'X': /* black bg */ ! sp->back = COL_BLACK; ! break; ! case 'Y': /* yellow bg */ ! sp->back = COL_YELLOW; break; } } ! dump_ansi_codes(sp, buff, bp); ! arg1 = args[1]; process_expression(buff, bp, &arg1, executor, caller, enactor, PE_DEFAULT, PT_DEFAULT, pe_info); ! dump_ansi_codes(--sp, buff, bp); } /* ARGSUSED */ *************** *** 1224,1230 **** * functions. */ while (i <= maxlen + 1) { ! if (str[i] == '\n') return i; i++; } --- 1309,1315 ---- * functions. */ while (i <= maxlen + 1) { ! if ((str[i] == '\n') || (str[i] == '\r')) return i; i++; } *************** *** 1311,1316 **** --- 1396,1403 ---- /* normal line */ strncpy(strbuff, pstr, ansilen); strbuff[ansilen] = '\0'; + if (pstr[ansilen] == '\r') + ++ansilen; pstr += ansilen + 1; /* move to start of next line */ } safe_str(strbuff, buff, bp); *** 1_7_4.82/src/fundb.c Sat, 07 Apr 2001 10:14:58 -0500 dunemush (pennmush/c/17_fundb.c 1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.7.1.3.1.3.1.3.1.2.1.2.1.3.2.1.2.1 660) --- 1_7_4.93(w)/src/fundb.c Sun, 13 May 2001 08:36:07 -0500 dunemush (pennmush/c/17_fundb.c 1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.7.1.3.1.3.1.3.1.2.1.2.1.3.2.1.2.1.2.1 660) *************** *** 1230,1236 **** if (strchr(args[0], '/')) { parse_attrib(executor, args[0], &thing, &attrib); if (!GoodObject(thing) || !attrib ! || !Can_Read_Attr(executor, thing, attrib)) safe_str("#-1", buff, bp); else safe_dbref(attrib->creator, buff, bp); } else { --- 1230,1237 ---- if (strchr(args[0], '/')) { parse_attrib(executor, args[0], &thing, &attrib); if (!GoodObject(thing) || !attrib ! || !Can_Read_Attr(executor, thing, attrib)) ! safe_str("#-1", buff, bp); else safe_dbref(attrib->creator, buff, bp); } else { *************** *** 1702,1709 **** } *p++ = '\0'; ! if ( ! (thing = noisy_match_result(executor, args[0], NOTYPE, MAT_EVERYTHING)) == NOTHING) { safe_str(T(e_notvis), buff, bp); --- 1703,1709 ---- } *p++ = '\0'; ! if ((thing = noisy_match_result(executor, args[0], NOTYPE, MAT_EVERYTHING)) == NOTHING) { safe_str(T(e_notvis), buff, bp); *** 1_7_4.82/src/function.c Sat, 17 Feb 2001 10:57:35 -0600 dunemush (pennmush/c/18_function.c 1.29.1.14.1.3 660) --- 1_7_4.93(w)/src/function.c Tue, 15 May 2001 15:58:44 -0500 dunemush (pennmush/c/18_function.c 1.29.1.14.1.3.1.1 660) *************** *** 860,869 **** } /* a completely new entry. First, insert it into general hash table */ fp = (FUN *) mush_malloc(sizeof(FUN), "func_hash.FUN"); ! fp->name = (char *) strdup(name); ! #ifdef MEM_CHECK ! add_check("func_hash.name"); ! #endif fp->where.offset = userfn_count; fp->minargs = 0; fp->maxargs = 10; --- 860,866 ---- } /* a completely new entry. First, insert it into general hash table */ fp = (FUN *) mush_malloc(sizeof(FUN), "func_hash.FUN"); ! fp->name = mush_strdup(name, "func_hash.name"); fp->where.offset = userfn_count; fp->minargs = 0; fp->maxargs = 10; *************** *** 872,886 **** /* now add it to the user function table */ userfn_tab[userfn_count].thing = thing; ! userfn_tab[userfn_count].name = (char *) strdup(upcasestr(argv[2])); ! #ifdef MEM_CHECK ! add_check("userfn_tab.name"); ! #endif ! userfn_tab[userfn_count].fn = (char *) strdup(upcasestr(name)); ! #ifdef MEM_CHECK ! add_check("userfn_tab.fn"); ! #endif ! userfn_count++; notify(player, T("Function added.")); --- 869,876 ---- /* now add it to the user function table */ userfn_tab[userfn_count].thing = thing; ! userfn_tab[userfn_count].name = mush_strdup(upcasestr(argv[2]), "userfn_tab.name"); ! userfn_tab[userfn_count].fn = mush_strdup(upcasestr(name), "usrfn_tab.fn"); userfn_count++; notify(player, T("Function added.")); *************** *** 898,907 **** return; } fp = (FUN *) mush_malloc(sizeof(FUN), "func_hash.FUN"); ! fp->name = (char *) strdup(name); ! #ifdef MEM_CHECK ! add_check("func_hash.name"); ! #endif fp->where.offset = userfn_count; fp->minargs = 0; fp->maxargs = 10; --- 888,894 ---- return; } fp = (FUN *) mush_malloc(sizeof(FUN), "func_hash.FUN"); ! fp->name = mush_strdup(name, "func_hash.name"); fp->where.offset = userfn_count; fp->minargs = 0; fp->maxargs = 10; *************** *** 913,922 **** if (userfn_tab[fp->where.offset].name) mush_free((Malloc_t) userfn_tab[fp->where.offset].name, "userfn_tab.name"); ! userfn_tab[fp->where.offset].name = (char *) strdup(upcasestr(argv[2])); ! #ifdef MEM_CHECK ! add_check("userfn_tab.name"); ! #endif notify(player, T("Function updated.")); } } --- 900,906 ---- if (userfn_tab[fp->where.offset].name) mush_free((Malloc_t) userfn_tab[fp->where.offset].name, "userfn_tab.name"); ! userfn_tab[fp->where.offset].name = mush_strdup(upcasestr(argv[2]), "userfn_tab.name"); notify(player, T("Function updated.")); } } *************** *** 975,989 **** fp = (FUN *) hashfind(userfn_tab[i + 1].fn, &htab_user_function); fp->where.offset = i; userfn_tab[i].thing = userfn_tab[i + 1].thing; ! userfn_tab[i].name = (char *) strdup(userfn_tab[i + 1].name); ! #ifdef MEM_CHECK ! add_check("userfn_tab.name"); ! #endif mush_free((Malloc_t) userfn_tab[i + 1].name, "userfn_tab.name"); ! userfn_tab[i].fn = (char *) strdup(userfn_tab[i + 1].fn); ! #ifdef MEM_CHECK ! add_check("userfn_tab.fn"); ! #endif mush_free((Malloc_t) userfn_tab[i + 1].fn, "userfn_tab.fn"); } } --- 959,967 ---- fp = (FUN *) hashfind(userfn_tab[i + 1].fn, &htab_user_function); fp->where.offset = i; userfn_tab[i].thing = userfn_tab[i + 1].thing; ! userfn_tab[i].name = mush_strdup(userfn_tab[i + 1].name, "userfn_tab.name"); mush_free((Malloc_t) userfn_tab[i + 1].name, "userfn_tab.name"); ! userfn_tab[i].fn = mush_strdup(userfn_tab[i + 1].fn, "userfn_tab.fn"); mush_free((Malloc_t) userfn_tab[i + 1].fn, "userfn_tab.fn"); } } *************** *** 1039,1053 **** fp = (FUN *) hashfind(userfn_tab[i + 1].fn, &htab_user_function); fp->where.offset = i; userfn_tab[i].thing = userfn_tab[i + 1].thing; ! userfn_tab[i].name = (char *) strdup(userfn_tab[i + 1].name); ! #ifdef MEM_CHECK ! add_check("userfn_tab.name"); ! #endif mush_free((Malloc_t) userfn_tab[i + 1].name, "userfn_tab.name"); ! userfn_tab[i].fn = (char *) strdup(userfn_tab[i + 1].fn); ! #ifdef MEM_CHECK ! add_check("userfn_tab.fn"); ! #endif mush_free((Malloc_t) userfn_tab[i + 1].fn, "userfn_tab.fn"); } notify(player, T("Function deleted.")); --- 1017,1025 ---- fp = (FUN *) hashfind(userfn_tab[i + 1].fn, &htab_user_function); fp->where.offset = i; userfn_tab[i].thing = userfn_tab[i + 1].thing; ! userfn_tab[i].name = mush_strdup(userfn_tab[i + 1].name, "userfn_tab.name"); mush_free((Malloc_t) userfn_tab[i + 1].name, "userfn_tab.name"); ! userfn_tab[i].fn = mush_strdup(userfn_tab[i + 1].fn, "userfn_tab.fn"); mush_free((Malloc_t) userfn_tab[i + 1].fn, "userfn_tab.fn"); } notify(player, T("Function deleted.")); *** 1_7_4.82/src/flags.c Fri, 23 Mar 2001 14:12:35 -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 660) --- 1_7_4.93(w)/src/flags.c Sun, 13 May 2001 08:36:07 -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 660) *************** *** 610,616 **** * players. */ if (Wizard(thing) && (flagp->flag == PLAYER_GAGGED) && ! (flagp->type == TYPE_PLAYER)) return 0; /* can't gag wizards/God */ if (God(player)) /* God can do (almost) anything) */ return 1; --- 610,617 ---- * players. */ if (Wizard(thing) && (flagp->flag == PLAYER_GAGGED) && ! (flagp->type == TYPE_PLAYER)) ! return 0; /* can't gag wizards/God */ if (God(player)) /* God can do (almost) anything) */ return 1; *************** *** 1092,1098 **** } } if (((f->flag == QUIET) && (f->type == NOTYPE)) || ! (!AreQuiet(player, thing))) notify(player, T("Flag reset.")); } else { /* set the flag */ --- 1093,1100 ---- } } if (((f->flag == QUIET) && (f->type == NOTYPE)) || ! (!AreQuiet(player, thing))) ! notify(player, T("Flag reset.")); } else { /* set the flag */ *************** *** 1150,1156 **** } } if (((f->flag == QUIET) && (f->flag == NOTYPE)) || ! (!AreQuiet(player, thing))) notify(player, T("Flag set.")); } } --- 1152,1159 ---- } } if (((f->flag == QUIET) && (f->flag == NOTYPE)) || ! (!AreQuiet(player, thing))) ! notify(player, T("Flag set.")); } } *** 1_7_4.82/src/extmail.c Thu, 29 Mar 2001 13:30:28 -0600 dunemush (pennmush/c/22_extmail.c 1.44 660) --- 1_7_4.93(w)/src/extmail.c Sun, 13 May 2001 08:36:06 -0500 dunemush (pennmush/c/22_extmail.c 1.44.1.1 660) *************** *** 1460,1467 **** if (nargs == 1) { if (!is_integer(args[0])) { /* handle the case of wanting to count the number of messages */ ! if ( ! (player = noisy_match_result(executor, args[0], TYPE_PLAYER, MAT_OBJECTS)) == NOTHING) { safe_str(T("#-1 NO SUCH PLAYER"), buff, bp); --- 1460,1466 ---- if (nargs == 1) { if (!is_integer(args[0])) { /* handle the case of wanting to count the number of messages */ ! if ((player = noisy_match_result(executor, args[0], TYPE_PLAYER, MAT_OBJECTS)) == NOTHING) { safe_str(T("#-1 NO SUCH PLAYER"), buff, bp); *************** *** 1574,1581 **** } } else { /* Both a target and a message */ ! if ( ! (target = noisy_match_result(player, arg1, TYPE_PLAYER, MAT_OBJECTS)) == NOTHING) { return NULL; --- 1573,1579 ---- } } else { /* Both a target and a message */ ! if ((target = noisy_match_result(player, arg1, TYPE_PLAYER, MAT_OBJECTS)) == NOTHING) { return NULL; *************** *** 2075,2081 **** if (i != mail_top) { do_rawlog(LT_ERR, T("MAIL: mail_top is %d, only read in %d messages."), mail_top, i); ! } { char eodbuf[20]; fgets(eodbuf, sizeof(eodbuf), fp); if (!(eodbuf && !strcmp(eodbuf, (mail_flags & MDBF_NEW_EOD) --- 2073,2080 ---- if (i != mail_top) { do_rawlog(LT_ERR, T("MAIL: mail_top is %d, only read in %d messages."), mail_top, i); ! } ! { char eodbuf[20]; fgets(eodbuf, sizeof(eodbuf), fp); if (!(eodbuf && !strcmp(eodbuf, (mail_flags & MDBF_NEW_EOD) *************** *** 2194,2200 **** *r = '\0'; } /* put the attrib back */ ! (void) atr_add(player, "MAILFOLDERS", res, GOD, AF_WIZARD | AF_NOPROG | AF_LOCKED); mush_free((Malloc_t) res, "replace_string.buff"); mush_free((Malloc_t) new, "string"); mush_free((Malloc_t) pat, "string"); --- 2193,2200 ---- *r = '\0'; } /* put the attrib back */ ! (void) atr_add(player, "MAILFOLDERS", res, GOD, ! AF_WIZARD | AF_NOPROG | AF_LOCKED); mush_free((Malloc_t) res, "replace_string.buff"); mush_free((Malloc_t) new, "string"); mush_free((Malloc_t) pat, "string"); *************** *** 2232,2238 **** if (a) (void) atr_add(player, a->name, tbuf1, GOD, a->flags); else /* Shouldn't happen, but... */ ! (void) atr_add(player, "MAILCURF", tbuf1, GOD, AF_WIZARD | AF_NOPROG | AF_LOCKED); } static int --- 2232,2239 ---- if (a) (void) atr_add(player, a->name, tbuf1, GOD, a->flags); else /* Shouldn't happen, but... */ ! (void) atr_add(player, "MAILCURF", tbuf1, GOD, ! AF_WIZARD | AF_NOPROG | AF_LOCKED); } static int *************** *** 2591,2597 **** *msghigh = *msglow; } if (*msglow < 0 || (msghigh && *msghigh < 0) || *folder < 0 ! || *folder > MAX_FOLDERS) return 0; } else { /* No folder spec */ *folder = player_folder(player); --- 2592,2599 ---- *msghigh = *msglow; } if (*msglow < 0 || (msghigh && *msghigh < 0) || *folder < 0 ! || *folder > MAX_FOLDERS) ! return 0; } else { /* No folder spec */ *folder = player_folder(player); *************** *** 2664,2670 **** /* Is it an alias they can use? */ if (!((m->owner == player) || (m->nflags == 0) || (Hasprivs(player)) || ! ((m->nflags & ALIAS_MEMBERS) && ismember(m, player)))) return 0; #ifdef MAIL_SUBJECTS u_strcpy(keepsub, subject); --- 2666,2673 ---- /* Is it an alias they can use? */ if (!((m->owner == player) || (m->nflags == 0) || (Hasprivs(player)) || ! ((m->nflags & ALIAS_MEMBERS) && ismember(m, player)))) ! return 0; #ifdef MAIL_SUBJECTS u_strcpy(keepsub, subject); *** 1_7_4.82/src/csrimalloc.c Mon, 30 Oct 2000 13:34:40 -0600 dunemush (pennmush/c/26_csrimalloc 1.22 660) --- 1_7_4.93(w)/src/csrimalloc.c Sun, 13 May 2001 08:36:05 -0500 dunemush (pennmush/c/26_csrimalloc 1.23 660) *************** *** 190,196 **** extern caddr_t mmap proto((caddr_t, Size_t, int, int, int, off_t)); #endif ! #endif /* EXTERNS_H__ */ /* Do not add anything after this line */ /* $Id$ */ #ifndef __ASSERT_H__ --- 190,196 ---- extern caddr_t mmap proto((caddr_t, Size_t, int, int, int, off_t)); #endif ! #endif /* EXTERNS_H__ */ /* Do not add anything after this line */ /* $Id$ */ #ifndef __ASSERT_H__ *************** *** 210,216 **** #define ASSERT_SP(p, s, s2, sp) #define ASSERT_EP(p, s, s2, ep) #endif ! #endif /* __ASSERT_H__ */ /* Do not add anything after this line */ #ifndef EXIT_FAILURE #define EXIT_FAILURE 1 #endif --- 210,216 ---- #define ASSERT_SP(p, s, s2, sp) #define ASSERT_EP(p, s, s2, ep) #endif ! #endif /* __ASSERT_H__ */ /* Do not add anything after this line */ #ifndef EXIT_FAILURE #define EXIT_FAILURE 1 #endif *************** *** 317,323 **** /* Size_t with only the high-order bit turned on */ #define HIBITSZ (((Size_t) 1) << (BITS(Size_t) - 1)) ! #endif /* __ALIGN_H__ */ /* Do not add anything after this line */ /* * We assume that FREE is a 0 bit, and the tag for a free block, Or'ing the --- 317,323 ---- /* Size_t with only the high-order bit turned on */ #define HIBITSZ (((Size_t) 1) << (BITS(Size_t) - 1)) ! #endif /* __ALIGN_H__ */ /* Do not add anything after this line */ /* * We assume that FREE is a 0 bit, and the tag for a free block, Or'ing the *************** *** 663,669 **** #endif #endif ! #endif /* __DEFS_H__ */ /* Do not add anything after this line */ /* Author: Mark Moraes */ --- 663,669 ---- #endif #endif ! #endif /* __DEFS_H__ */ /* Do not add anything after this line */ /* Author: Mark Moraes */ *************** *** 719,726 **** #define _malloc_memfunc __MALF_memfunc ! #endif /* SHORTNAMES */ /* Do not add anything after this line */ ! #endif /* __GLOBALRENAME_H__ */ /* Do not add anything after this line */ const char *_malloc_version = "CSRI, University of Toronto Malloc Version 1.18alpha"; --- 719,726 ---- #define _malloc_memfunc __MALF_memfunc ! #endif /* SHORTNAMES */ /* Do not add anything after this line */ ! #endif /* __GLOBALRENAME_H__ */ /* Do not add anything after this line */ const char *_malloc_version = "CSRI, University of Toronto Malloc Version 1.18alpha"; *************** *** 846,852 **** extern int __m_prblock proto((univptr_t, int, FILE *)); ! #endif /* __GLOBALS_H__ */ /* Do not add anything after this line */ /* ** sptree.h: The following type declarations provide the binary tree --- 846,852 ---- extern int __m_prblock proto((univptr_t, int, FILE *)); ! #endif /* __GLOBALS_H__ */ /* Do not add anything after this line */ /* ** sptree.h: The following type declarations provide the binary tree *************** *** 943,949 **** else \ _malloc_leaktrace += 0 ! #endif /* __CSRI_TRACE_H__ */ /* Do not add anything after this line */ #include "confmagic.h" --- 943,949 ---- else \ _malloc_leaktrace += 0 ! #endif /* __CSRI_TRACE_H__ */ /* Do not add anything after this line */ #include "confmagic.h" *** 1_7_4.82/src/create.c Mon, 29 Jan 2001 09:51:40 -0600 dunemush (pennmush/c/27_create.c 1.27 660) --- 1_7_4.93(w)/src/create.c Sun, 13 May 2001 08:36:05 -0500 dunemush (pennmush/c/27_create.c 1.27.1.1 660) *************** *** 298,305 **** break; case TYPE_PLAYER: case TYPE_THING: ! if ( ! (room = noisy_match_result(player, room_name, NOTYPE, MAT_EVERYTHING)) < 0) { notify(player, T("No match.")); return; --- 298,304 ---- break; case TYPE_PLAYER: case TYPE_THING: ! if ((room = noisy_match_result(player, room_name, NOTYPE, MAT_EVERYTHING)) < 0) { notify(player, T("No match.")); return; *** 1_7_4.82/src/cque.c Mon, 23 Apr 2001 18:05:56 -0500 dunemush (pennmush/c/28_cque.c 1.35 660) --- 1_7_4.93(w)/src/cque.c Tue, 15 May 2001 15:58:44 -0500 dunemush (pennmush/c/28_cque.c 1.36.1.1 660) *************** *** 68,81 **** void free_qentry _((BQUE *point)); static int pay_queue _((dbref player, const char *command)); void wait_que ! _( ! (dbref player, int wait, char *command, dbref cause, dbref sem, const char *semattr, int until)); int que_next _((void)); static void show_queue ! _( ! (dbref player, dbref victim, int q_type, int q_quiet, int q_all, BQUE *q_ptr, int *tot, int *self, int *del)); static void do_raw_restart _((dbref victim)); static int waitable_attr _((dbref thing, const char *atr)); --- 68,79 ---- void free_qentry _((BQUE *point)); static int pay_queue _((dbref player, const char *command)); void wait_que ! _((dbref player, int wait, char *command, dbref cause, dbref sem, const char *semattr, int until)); int que_next _((void)); static void show_queue ! _((dbref player, dbref victim, int q_type, int q_quiet, int q_all, BQUE *q_ptr, int *tot, int *self, int *del)); static void do_raw_restart _((dbref victim)); static int waitable_attr _((dbref thing, const char *atr)); *************** *** 174,180 **** if (point->env[a]) { mush_free((Malloc_t) point->env[a], "bqueue_env"); } ! for (a = 0; a < 10; a++) if (point->rval[a]) { mush_free((Malloc_t) point->rval[a], "bqueue_rval"); } --- 172,178 ---- if (point->env[a]) { mush_free((Malloc_t) point->env[a], "bqueue_env"); } ! for (a = 0; a < NUMQ; a++) if (point->rval[a]) { mush_free((Malloc_t) point->rval[a], "bqueue_rval"); } *************** *** 226,236 **** if (!pay_queue(player, command)) /* make sure player can afford to do it */ return; tmp = (BQUE *) mush_malloc(sizeof(BQUE), "BQUE"); ! tmp->comm = (char *) strdup(command); tmp->semattr = NULL; - #ifdef MEM_CHECK - add_check("bqueue_comm"); - #endif tmp->player = player; tmp->queued = QUEUE_PER_OWNER ? Owner(player) : player; tmp->next = NULL; --- 224,231 ---- if (!pay_queue(player, command)) /* make sure player can afford to do it */ return; tmp = (BQUE *) mush_malloc(sizeof(BQUE), "BQUE"); ! tmp->comm = mush_strdup(command, "bqueue_comm"); tmp->semattr = NULL; tmp->player = player; tmp->queued = QUEUE_PER_OWNER ? Owner(player) : player; tmp->next = NULL; *************** *** 240,258 **** if (!wnxt[a]) tmp->env[a] = NULL; else { ! tmp->env[a] = (char *) strdup(wnxt[a]); ! #ifdef MEM_CHECK ! add_check("bqueue_env"); ! #endif } for (a = 0; a < NUMQ; a++) if (!rnxt[a] || !rnxt[a][0]) tmp->rval[a] = NULL; else { ! tmp->rval[a] = (char *) strdup(rnxt[a]); ! #ifdef MEM_CHECK ! add_check("bqueue_rval"); ! #endif } if (IsPlayer(cause)) { if (qlast) { --- 235,247 ---- if (!wnxt[a]) tmp->env[a] = NULL; else { ! tmp->env[a] = mush_strdup(wnxt[a], "bqueue_env"); } for (a = 0; a < NUMQ; a++) if (!rnxt[a] || !rnxt[a][0]) tmp->rval[a] = NULL; else { ! tmp->rval[a] = mush_strdup(rnxt[a], "bqueue_rval"); } if (IsPlayer(cause)) { if (qlast) { *************** *** 328,337 **** if (!pay_queue(player, command)) /* make sure player can afford to do it */ return; tmp = (BQUE *) mush_malloc(sizeof(BQUE), "BQUE"); ! tmp->comm = (char *) strdup(command); ! #ifdef MEM_CHECK ! add_check("bqueue_comm"); ! #endif tmp->player = player; tmp->queued = QUEUE_PER_OWNER ? Owner(player) : player; tmp->cause = cause; --- 317,323 ---- if (!pay_queue(player, command)) /* make sure player can afford to do it */ return; tmp = (BQUE *) mush_malloc(sizeof(BQUE), "BQUE"); ! tmp->comm = mush_strdup(command, "bqueue_comm"); tmp->player = player; tmp->queued = QUEUE_PER_OWNER ? Owner(player) : player; tmp->cause = cause; *************** *** 340,359 **** if (!wnxt[a]) tmp->env[a] = NULL; else { ! tmp->env[a] = (char *) strdup(wnxt[a]); ! #ifdef MEM_CHECK ! add_check("bqueue_env"); ! #endif } } for (a = 0; a < NUMQ; a++) { if (!rnxt[a] || !rnxt[a][0]) tmp->rval[a] = NULL; else { ! tmp->rval[a] = (char *) strdup(rnxt[a]); ! #ifdef MEM_CHECK ! add_check("bqueue_rval"); ! #endif } } --- 326,339 ---- if (!wnxt[a]) tmp->env[a] = NULL; else { ! tmp->env[a] = mush_strdup(wnxt[a], "bqueue_env"); } } for (a = 0; a < NUMQ; a++) { if (!rnxt[a] || !rnxt[a][0]) tmp->rval[a] = NULL; else { ! tmp->rval[a] = mush_strdup(rnxt[a], "bqueue_rval"); } } *************** *** 381,390 **** } else { /* Put it on the semaphore queue, sorted by time */ ! tmp->semattr = strdup(semattr ? semattr : "SEMAPHORE"); ! #ifdef MEM_CHECK ! add_check("bqueue_semattr"); ! #endif if (!tmp->left) { /* No timeout, just shove it on the end */ tmp->next = NULL; if (qsemlast != NULL) --- 361,367 ---- } else { /* Put it on the semaphore queue, sorted by time */ ! tmp->semattr = mush_strdup(semattr ? semattr : "SEMAPHORE", "bqueue_semattr"); if (!tmp->left) { /* No timeout, just shove it on the end */ tmp->next = NULL; if (qsemlast != NULL) *************** *** 679,688 **** } else { aname = (char *) "SEMAPHORE"; } ! if ( ! (thing = ! noisy_match_result(player, what, NOTYPE, ! MAT_EVERYTHING)) == NOTHING) return; /* must control something or have it link_ok in order to use it as * as a semaphore. */ --- 656,664 ---- } else { aname = (char *) "SEMAPHORE"; } ! if ((thing = ! noisy_match_result(player, what, NOTYPE, MAT_EVERYTHING)) == NOTHING) ! return; /* must control something or have it link_ok in order to use it as * as a semaphore. */ *************** *** 737,744 **** aname = strchr(arg1, '/'); if (aname) *aname++ = '\0'; ! if ( ! (thing = noisy_match_result(player, arg1, NOTYPE, MAT_EVERYTHING)) == NOTHING) { mush_free(arg2, "strip_braces.buff"); return; --- 713,719 ---- aname = strchr(arg1, '/'); if (aname) *aname++ = '\0'; ! if ((thing = noisy_match_result(player, arg1, NOTYPE, MAT_EVERYTHING)) == NOTHING) { mush_free(arg2, "strip_braces.buff"); return; *************** *** 991,1000 **** if (*arg1 == '\0') do_halt(player, "", player); else { ! if ( ! (victim = ! noisy_match_result(player, arg1, NOTYPE, ! MAT_OBJECTS)) == NOTHING) return; if (!Owns(player, victim) && !HaltAny(player)) { notify(player, T("Permission denied.")); return; --- 966,974 ---- if (*arg1 == '\0') do_halt(player, "", player); else { ! if ((victim = ! noisy_match_result(player, arg1, NOTYPE, MAT_OBJECTS)) == NOTHING) ! return; if (!Owns(player, victim) && !HaltAny(player)) { notify(player, T("Permission denied.")); return; *************** *** 1102,1111 **** do_halt(player, "", player); do_raw_restart(player); } else { ! if ( ! (victim = ! noisy_match_result(player, arg1, NOTYPE, ! MAT_OBJECTS)) == NOTHING) return; if (!Owns(player, victim) && !HaltAny(player)) { notify(player, T("Permission denied.")); return; --- 1076,1084 ---- do_halt(player, "", player); do_raw_restart(player); } else { ! if ((victim = ! noisy_match_result(player, arg1, NOTYPE, MAT_OBJECTS)) == NOTHING) ! return; if (!Owns(player, victim) && !HaltAny(player)) { notify(player, T("Permission denied.")); return; *** 1_7_4.82/src/command.c Sat, 07 Apr 2001 13:33:48 -0500 dunemush (pennmush/c/36_command.c 1.56.1.1.1.1.1.1 660) --- 1_7_4.93(w)/src/command.c Sun, 13 May 2001 08:36:03 -0500 dunemush (pennmush/c/36_command.c 1.56.1.1.1.1.1.1.1.2.1.1 660) *************** *** 117,123 **** CMD_T_NOGAGGED, 0, 0, 0}, {"@ELOCK", NULL, cmd_elock, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0, 0}, ! {"@EMIT", "ROOM NOEVAL SILENT", cmd_emit, CMD_T_ANY | CMD_T_NOGAGGED, 0, 0, 0}, {"@ENABLE", NULL, cmd_enable, CMD_T_ANY | CMD_T_NOGAGGED, WIZARD, 0, 0}, {"@ENTRANCES", "EXITS THINGS PLAYERS ROOMS", cmd_entrances, --- 117,124 ---- CMD_T_NOGAGGED, 0, 0, 0}, {"@ELOCK", NULL, cmd_elock, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0, 0}, ! {"@EMIT", "ROOM NOEVAL SILENT", cmd_emit, CMD_T_ANY | CMD_T_NOGAGGED, 0, 0, ! 0}, {"@ENABLE", NULL, cmd_enable, CMD_T_ANY | CMD_T_NOGAGGED, WIZARD, 0, 0}, {"@ENTRANCES", "EXITS THINGS PLAYERS ROOMS", cmd_entrances, *************** *** 154,160 **** CMD_T_ANY | CMD_T_NOGAGGED, WIZARD, 0, 0}, #ifdef USE_MAILER {"@MAIL", ! "NOEVAL NOSIG STATS DSTATS FSTATS DEBUG NUKE FOLDER UNFOLDER LIST READ CLEAR UNCLEAR PURGE FILE TAG UNTAG FWD FORWARD SEND SILENT URGENT", cmd_mail, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0, 0}, #ifdef MAIL_ALIASES --- 155,161 ---- CMD_T_ANY | CMD_T_NOGAGGED, WIZARD, 0, 0}, #ifdef USE_MAILER {"@MAIL", ! "NOEVAL NOSIG STATS DSTATS FSTATS DEBUG NUKE FOLDERS UNFOLDER LIST READ CLEAR UNCLEAR PURGE FILE TAG UNTAG FWD FORWARD SEND SILENT URGENT", cmd_mail, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0, 0}, #ifdef MAIL_ALIASES *************** *** 290,296 **** CMD_T_PLAYER | CMD_T_THING | CMD_T_NOGAGGED, 0, 0, 0}, {"GET", NULL, cmd_get, CMD_T_PLAYER | CMD_T_THING | CMD_T_NOGAGGED, 0, 0, 0}, ! {"GIVE", NULL, cmd_give, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0, 0}, {"GOTO", NULL, cmd_goto, CMD_T_PLAYER | CMD_T_THING, 0, 0, 0}, {"INVENTORY", NULL, cmd_inventory, CMD_T_ANY, 0, 0, 0}, --- 291,297 ---- CMD_T_PLAYER | CMD_T_THING | CMD_T_NOGAGGED, 0, 0, 0}, {"GET", NULL, cmd_get, CMD_T_PLAYER | CMD_T_THING | CMD_T_NOGAGGED, 0, 0, 0}, ! {"GIVE", "SILENT", cmd_give, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_NOGAGGED, 0, 0, 0}, {"GOTO", NULL, cmd_goto, CMD_T_PLAYER | CMD_T_THING, 0, 0, 0}, {"INVENTORY", NULL, cmd_inventory, CMD_T_ANY, 0, 0, 0}, *************** *** 412,419 **** switch_mask *sw; #ifdef CAN_TAKE_ARGS_IN_FP void (*func) ! _( ! (COMMAND_INFO *cmd, dbref player, dbref cause, switch_mask sw, char *raw, char *switches, char *args_raw, char *arg_left, char *args_left[MAX_ARG], char *arg_right, char *args_right[MAX_ARG])); #else --- 413,419 ---- switch_mask *sw; #ifdef CAN_TAKE_ARGS_IN_FP void (*func) ! _((COMMAND_INFO *cmd, dbref player, dbref cause, switch_mask sw, char *raw, char *switches, char *args_raw, char *arg_left, char *args_left[MAX_ARG], char *arg_right, char *args_right[MAX_ARG])); #else *************** *** 457,464 **** switch_mask *sw; #ifdef CAN_TAKE_ARGS_IN_FP void (*func) ! _( ! (COMMAND_INFO *cmd, dbref player, dbref cause, switch_mask sw, char *raw, char *switches, char *args_raw, char *arg_left, char *args_left[MAX_ARG], char *arg_right, char *args_right[MAX_ARG])); #else --- 457,463 ---- switch_mask *sw; #ifdef CAN_TAKE_ARGS_IN_FP void (*func) ! _((COMMAND_INFO *cmd, dbref player, dbref cause, switch_mask sw, char *raw, char *switches, char *args_raw, char *arg_left, char *args_left[MAX_ARG], char *arg_right, char *args_right[MAX_ARG])); #else *************** *** 1308,1315 **** * any match, the player is ok to do the command. Toggles really * should only be used if the command is type-restricted, too! */ ! if (!( ! ((cmd->flags == 0) && (cmd->toggles == 0) && (cmd->powers == 0)) || ((cmd->flags) && (cmd->flags & Flags(player))) || ((cmd->toggles) && (cmd->toggles & Toggles(player))) || ((cmd->powers) && (cmd->powers & Powers(player))))) { --- 1307,1313 ---- * any match, the player is ok to do the command. Toggles really * should only be used if the command is type-restricted, too! */ ! if (!(((cmd->flags == 0) && (cmd->toggles == 0) && (cmd->powers == 0)) || ((cmd->flags) && (cmd->flags & Flags(player))) || ((cmd->toggles) && (cmd->toggles & Toggles(player))) || ((cmd->powers) && (cmd->powers & Powers(player))))) { *** 1_7_4.82/src/cmds.c Sat, 07 Apr 2001 13:33:48 -0500 dunemush (pennmush/c/37_cmds.c 1.33.1.1.1.2 660) --- 1_7_4.93(w)/src/cmds.c Sun, 13 May 2001 08:36:03 -0500 dunemush (pennmush/c/37_cmds.c 1.33.1.1.1.2.1.2 660) *************** *** 482,488 **** do_mail_debug(player, arg_left, arg_right); else if (SW_ISSET(sw, SWITCH_NUKE)) do_mail_nuke(player); ! else if (SW_ISSET(sw, SWITCH_FOLDER)) do_mail_change_folder(player, arg_left, arg_right); else if (SW_ISSET(sw, SWITCH_UNFOLDER)) do_mail_unfolder(player, arg_left); --- 482,488 ---- do_mail_debug(player, arg_left, arg_right); else if (SW_ISSET(sw, SWITCH_NUKE)) do_mail_nuke(player); ! else if (SW_ISSET(sw, SWITCH_FOLDERS)) do_mail_change_folder(player, arg_left, arg_right); else if (SW_ISSET(sw, SWITCH_UNFOLDER)) do_mail_unfolder(player, arg_left); *************** *** 949,955 **** } COMMAND (cmd_give) { ! do_give(player, arg_left, arg_right); } COMMAND (cmd_goto) { --- 949,955 ---- } COMMAND (cmd_give) { ! do_give(player, arg_left, arg_right, (SW_ISSET(sw, SWITCH_SILENT))); } COMMAND (cmd_goto) { *** 1_7_4.82/src/bsd.c Thu, 12 Apr 2001 14:39:32 -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 660) --- 1_7_4.93(w)/src/bsd.c Tue, 15 May 2001 15:58: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 660) *************** *** 154,161 **** extern int que_next _((void)); /* from cque.c */ extern int on_second; extern void dispatch _((void)); /* from timer.c */ ! extern dbref email_register_player ! _((const char *name, const char *email, const char *host, const char *ip)); /* from player.c */ extern time_t start_time, first_start_time; extern int reboot_count; --- 154,160 ---- extern int que_next _((void)); /* from cque.c */ extern int on_second; extern void dispatch _((void)); /* from timer.c */ ! extern dbref email_register_player _((const char *name, const char *email, const char *host, const char *ip)); /* from player.c */ extern time_t start_time, first_start_time; extern int reboot_count; *************** *** 1129,1138 **** p++; } *o = '\0'; ! messages[type].message = strdup(tbuf); ! #ifdef MEM_CHECK ! add_check("string"); ! #endif return messages[type].message; } else if (type == NA_PASCII) { /* PLAYER Ascii. Different output. \n is \r\n */ --- 1128,1134 ---- p++; } *o = '\0'; ! messages[type].message = mush_strdup(tbuf, "string"); return messages[type].message; } else if (type == NA_PASCII) { /* PLAYER Ascii. Different output. \n is \r\n */ *************** *** 1157,1166 **** p++; } *o = '\0'; ! messages[type].message = strdup(tbuf); ! #ifdef MEM_CHECK ! add_check("string"); ! #endif return messages[type].message; } for (n = 0; n < 6; n++) { --- 1153,1159 ---- p++; } *o = '\0'; ! messages[type].message = mush_strdup(tbuf, "string"); return messages[type].message; } for (n = 0; n < 6; n++) { *************** *** 1340,1354 **** if (state[TA_BOLD] || state[TA_REV] || state[TA_BLINK] || state[TA_ULINE] || (color && (state[TA_FGC] || state[TA_BGC]))) ! safe_str(ANSI_NORMAL, t, &o); break; } *o = '\0'; ! messages[type].message = strdup(tbuf); ! #ifdef MEM_CHECK ! add_check("string"); ! #endif return messages[type].message; } --- 1333,1344 ---- if (state[TA_BOLD] || state[TA_REV] || state[TA_BLINK] || state[TA_ULINE] || (color && (state[TA_FGC] || state[TA_BGC]))) ! safe_str(ANSI_NORMAL, t, &o); break; } *o = '\0'; ! messages[type].message = mush_strdup(tbuf, "string"); return messages[type].message; } *************** *** 1557,1566 **** paranoids[i].made = 0; } ! msgbuf = strdup(message); ! #ifdef MEM_CHECK ! add_check("string"); ! #endif target = NOTHING; --- 1547,1553 ---- paranoids[i].made = 0; } ! msgbuf = mush_strdup(message, "string"); target = NOTHING; *************** *** 3437,3446 **** while (*command && isspace(*command)) command++; if (*command) ! *userstring = strdup(command); ! #ifdef MEM_CHECK ! add_check("userstring"); ! #endif } void --- 3424,3430 ---- while (*command && isspace(*command)) command++; if (*command) ! *userstring = mush_strdup(command, "userstring"); } void *************** *** 4522,4528 **** /* now smash undesirable characters and truncate */ for (i = 0; i < DOING_LEN; i++) { if ((buf[i] == '\r') || (buf[i] == '\n') || ! (buf[i] == '\t') || (buf[i] == BEEP_CHAR)) buf[i] = ' '; } buf[DOING_LEN - 1] = '\0'; --- 4506,4513 ---- /* now smash undesirable characters and truncate */ for (i = 0; i < DOING_LEN; i++) { if ((buf[i] == '\r') || (buf[i] == '\n') || ! (buf[i] == '\t') || (buf[i] == BEEP_CHAR)) ! buf[i] = ' '; } buf[DOING_LEN - 1] = '\0'; *************** *** 4691,4697 **** DESC_ITER_CONN(d) { if ((d->player == target) && (!Hidden(d) || Priv_Who(executor)) && ! (!match || (d->last_time > match->last_time))) match = d; } if (match) safe_integer(match->pueblo, buff, bp); --- 4676,4683 ---- DESC_ITER_CONN(d) { if ((d->player == target) && (!Hidden(d) || Priv_Who(executor)) && ! (!match || (d->last_time > match->last_time))) ! match = d; } if (match) safe_integer(match->pueblo, buff, bp); *************** *** 4728,4734 **** DESC_ITER_CONN(d) { if ((d->player == target) && (!Hidden(d) || Priv_Who(executor)) && ! (!match || (d->last_time > match->last_time))) match = d; } if (match) --- 4714,4721 ---- DESC_ITER_CONN(d) { if ((d->player == target) && (!Hidden(d) || Priv_Who(executor)) && ! (!match || (d->last_time > match->last_time))) ! match = d; } if (match) *************** *** 4766,4772 **** DESC_ITER_CONN(d) { if ((d->player == target) && (!Hidden(d) || Priv_Who(executor)) && ! (!match || (d->connected_at < match->connected_at))) match = d; } if (match) --- 4753,4760 ---- DESC_ITER_CONN(d) { if ((d->player == target) && (!Hidden(d) || Priv_Who(executor)) && ! (!match || (d->connected_at < match->connected_at))) ! match = d; } if (match) *************** *** 5403,5409 **** descriptor_list = d; if (d->connected && d->player && GoodObject(d->player) && ! IsPlayer(d->player)) Toggles(d->player) |= PLAYER_CONNECT; else if ((!d->player || !GoodObject(d->player)) && d->connected) { d->connected = 0; d->player = 0; --- 5391,5398 ---- descriptor_list = d; if (d->connected && d->player && GoodObject(d->player) && ! IsPlayer(d->player)) ! Toggles(d->player) |= PLAYER_CONNECT; else if ((!d->player || !GoodObject(d->player)) && d->connected) { d->connected = 0; d->player = 0; *** 1_7_4.82/src/attrib.c Fri, 23 Feb 2001 12:29:59 -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 660) --- 1_7_4.93(w)/src/attrib.c Sun, 13 May 2001 08:36:02 -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 660) *************** *** 944,951 **** was_listener = Listener(thing); res = ! s ? atr_add(thing, name, s, player, ! (flags & 0x02) ? AF_NOPROG : NOTHING) : atr_clr(thing, name, player); if (res == AE_SAFE) { notify(player, T("That attribute is SAFE. Set it !SAFE to modify it.")); --- 944,950 ---- was_listener = Listener(thing); res = ! s ? atr_add(thing, name, s, player, (flags & 0x02) ? AF_NOPROG : NOTHING) : atr_clr(thing, name, player); if (res == AE_SAFE) { notify(player, T("That attribute is SAFE. Set it !SAFE to modify it.")); *************** *** 1022,1028 **** *p++ = '\0'; if ((thing = noisy_match_result(player, arg1, NOTYPE, MAT_EVERYTHING)) == ! NOTHING) return; if (!controls(player, thing)) { notify(player, T("Permission denied.")); --- 1021,1028 ---- *p++ = '\0'; if ((thing = noisy_match_result(player, arg1, NOTYPE, MAT_EVERYTHING)) == ! NOTHING) ! return; if (!controls(player, thing)) { notify(player, T("Permission denied.")); *************** *** 1081,1087 **** *p++ = '\0'; if ((thing = noisy_match_result(player, arg1, NOTYPE, MAT_EVERYTHING)) == ! NOTHING) return; if (!controls(player, thing)) { notify(player, T("Permission denied.")); --- 1081,1088 ---- *p++ = '\0'; if ((thing = noisy_match_result(player, arg1, NOTYPE, MAT_EVERYTHING)) == ! NOTHING) ! return; if (!controls(player, thing)) { notify(player, T("Permission denied.")); *** 1_7_4.82/src/access.c Mon, 29 Jan 2001 09:51:40 -0600 dunemush (pennmush/c/43_access.c 1.11 660) --- 1_7_4.93(w)/src/access.c Sun, 13 May 2001 08:36:02 -0500 dunemush (pennmush/c/43_access.c 1.11.1.1 660) *************** *** 120,127 **** static struct access *access_top; extern int reserved; /* reserved file descriptor */ static int add_access_node ! _( ! (const char *host, const dbref who, const int can, const int cant, const char *comment)); static void free_access_list _((void)); --- 120,126 ---- static struct access *access_top; extern int reserved; /* reserved file descriptor */ static int add_access_node ! _((const char *host, const dbref who, const int can, const int cant, const char *comment)); static void free_access_list _((void)); *** 1_7_4.82/hdrs/csrimalloc.h Thu, 20 Jul 2000 17:42:54 -0500 dunemush (pennmush/c/45_csrimalloc 1.4 660) --- 1_7_4.93(w)/hdrs/csrimalloc.h Sun, 13 May 2001 08:36:14 -0500 dunemush (pennmush/c/45_csrimalloc 1.5 660) *************** *** 95,98 **** #endif /* sparc */ ! #endif /* __CSRIMALLOC_H__ */ /* Do not add anything after this line */ --- 95,98 ---- #endif /* sparc */ ! #endif /* __CSRIMALLOC_H__ */ /* Do not add anything after this line */ *** 1_7_4.82/hdrs/version.h Mon, 23 Apr 2001 18:06:35 -0500 dunemush (pennmush/c/47_version.h 1.32.1.2.1.6 660) --- 1_7_4.93(w)/hdrs/version.h Sun, 13 May 2001 08:36:20 -0500 dunemush (pennmush/c/47_version.h 1.32.1.2.1.7.1.1 660) *************** *** 1,2 **** ! #define VERSION "PennMUSH version 1.7.4 patchlevel 3 [04/23/2001]" ! #define SHORTVN "PennMUSH 1.7.4p3" --- 1,2 ---- ! #define VERSION "PennMUSH version 1.7.4 patchlevel 4 [05/13/2001]" ! #define SHORTVN "PennMUSH 1.7.4p4" *** 1_7_4.82/hdrs/malias.h Sun, 04 Mar 2001 18:27:45 -0600 dunemush (pennmush/d/5_malias.h 1.13 660) --- 1_7_4.93(w)/hdrs/malias.h Tue, 15 May 2001 15:58:44 -0500 dunemush (pennmush/d/5_malias.h 1.14 660) *************** *** 12,18 **** #define ALIAS_OWNER 0x4 /* Only the owner */ struct mail_alias { ! unsigned char *name; unsigned char *desc; /* Description */ int size; /* Size of the members array */ dbref *members; /* Pointer to an array of dbrefs */ --- 12,18 ---- #define ALIAS_OWNER 0x4 /* Only the owner */ struct mail_alias { ! char *name; unsigned char *desc; /* Description */ int size; /* Size of the members array */ dbref *members; /* Pointer to an array of dbrefs */ *** 1_7_4.82/hdrs/game.h Thu, 08 Feb 2001 23:01:41 -0600 dunemush (pennmush/d/12_game.h 1.27 660) --- 1_7_4.93(w)/hdrs/game.h Sun, 13 May 2001 08:36:14 -0500 dunemush (pennmush/d/12_game.h 1.28.1.1 660) *************** *** 74,81 **** /* From predicat.c */ extern void do_switch ! _( ! (dbref player, char *expression, char **argv, dbref cause, int first, int notifyme)); extern void do_verb _((dbref player, dbref cause, char *arg1, char **argv)); extern void do_grep --- 74,80 ---- /* From predicat.c */ extern void do_switch ! _((dbref player, char *expression, char **argv, dbref cause, int first, int notifyme)); extern void do_verb _((dbref player, dbref cause, char *arg1, char **argv)); extern void do_grep *************** *** 83,89 **** /* From rob.c */ extern void do_kill _((dbref player, const char *what, int cost, int slay)); ! extern void do_give _((dbref player, char *recipient, char *amnt)); /* From set.c */ extern void do_name _((dbref player, const char *name, char *newname)); --- 82,88 ---- /* From rob.c */ extern void do_kill _((dbref player, const char *what, int cost, int slay)); ! extern void do_give _((dbref player, char *recipient, char *amnt, int silent)); /* From set.c */ extern void do_name _((dbref player, const char *name, char *newname)); *************** *** 112,119 **** extern void do_pose _((dbref player, const char *tbuf1, int space)); extern void do_wall _((dbref player, const char *message, int privs, int key)); extern void do_page ! _( ! (dbref player, const char *arg1, const char *arg2, dbref cause, int noeval, int multipage)); extern void do_think _((dbref player, const char *message)); extern void do_emit _((dbref player, const char *tbuf1)); --- 111,117 ---- extern void do_pose _((dbref player, const char *tbuf1, int space)); extern void do_wall _((dbref player, const char *message, int privs, int key)); extern void do_page ! _((dbref player, const char *arg1, const char *arg2, dbref cause, int noeval, int multipage)); extern void do_think _((dbref player, const char *message)); extern void do_emit _((dbref player, const char *tbuf1)); *** 1_7_4.82/hdrs/function.h Sat, 17 Feb 2001 10:56:52 -0600 dunemush (pennmush/d/13_function.h 1.11 660) --- 1_7_4.93(w)/hdrs/function.h Sun, 13 May 2001 08:36:14 -0500 dunemush (pennmush/d/13_function.h 1.11.1.1 660) *************** *** 92,99 **** char const *called_as, PE_Info *pe_info)) #ifdef CAN_TAKE_ARGS_IN_FP extern void function_add _((const char *name, void (*fun) ! _( ! (char *buff, char **bp, int nargs, char *args[], dbref executor, dbref caller, dbref enactor, char const *called_as, PE_Info * pe_info)), int minargs, --- 92,98 ---- char const *called_as, PE_Info *pe_info)) #ifdef CAN_TAKE_ARGS_IN_FP extern void function_add _((const char *name, void (*fun) ! _((char *buff, char **bp, int nargs, char *args[], dbref executor, dbref caller, dbref enactor, char const *called_as, PE_Info * pe_info)), int minargs, *** 1_7_4.82/hdrs/externs.h Fri, 23 Mar 2001 14:12:35 -0600 dunemush (pennmush/d/16_externs.h 1.1.1.53.1.1 660) --- 1_7_4.93(w)/hdrs/externs.h Tue, 15 May 2001 15:58:44 -0500 dunemush (pennmush/d/16_externs.h 1.1.1.53.1.2.1.1 660) *************** *** 44,51 **** extern DESC *port_desc _((int port)); /* find descriptors */ extern void WIN32_CDECL flag_broadcast _((object_flag_type inflags, object_flag_type intoggles, ! const char *fmt, ! ...)) __attribute__ ((__format__(__printf__, 3, 4))); extern void raw_notify _((dbref player, const char *msg)); --- 44,50 ---- extern DESC *port_desc _((int port)); /* find descriptors */ extern void WIN32_CDECL flag_broadcast _((object_flag_type inflags, object_flag_type intoggles, ! const char *fmt, ...)) __attribute__ ((__format__(__printf__, 3, 4))); extern void raw_notify _((dbref player, const char *msg)); *************** *** 188,193 **** --- 187,194 ---- extern void move_wrapper _((dbref player, const char *command)); extern void do_follow _((dbref player, const char *arg)); extern void do_unfollow _((dbref player, const char *arg)); + extern void do_desert _((dbref player, const char *arg)); + extern void do_dismiss _((dbref player, const char *arg)); extern void clear_followers _((dbref leader, int noisy)); extern void clear_following _((dbref follower, int noisy)); *************** *** 278,285 **** _((unsigned char *target, const unsigned char *source)); #define u_strdup(x) (unsigned char *)strdup((char *) x) #ifndef HAS_STRDUP ! extern char *strdup _((const char *s)); #endif #ifdef WIN32 #ifndef HAS_VSNPRINTF #define HAS_VSNPRINTF --- 279,287 ---- _((unsigned char *target, const unsigned char *source)); #define u_strdup(x) (unsigned char *)strdup((char *) x) #ifndef HAS_STRDUP ! char *strdup _((const char *s)); #endif + char *mush_strdup _((const char *s, const char *check)); #ifdef WIN32 #ifndef HAS_VSNPRINTF #define HAS_VSNPRINTF *** 1_7_4.82/hdrs/ansi.h Thu, 20 Jul 2000 17:42:54 -0500 dunemush (pennmush/d/27_ansi.h 1.2 660) --- 1_7_4.93(w)/hdrs/ansi.h Sun, 13 May 2001 08:36:13 -0500 dunemush (pennmush/d/27_ansi.h 1.4 660) *************** *** 16,26 **** --- 16,37 ---- #ifndef __ANSI_H #define __ANSI_H + #define ANSI_BLACK_V (30) + #define ANSI_RED_V (31) + #define ANSI_GREEN_V (32) + #define ANSI_YELLOW_V (33) + #define ANSI_BLUE_V (34) + #define ANSI_MAGENTA_V (35) + #define ANSI_CYAN_V (36) + #define ANSI_WHITE_V (37) + #ifndef OLD_ANSI #define BEEP_CHAR '\a' #define ESC_CHAR '\x1B' + #define ANSI_BEGIN "\x1B[" + #define ANSI_NORMAL "\x1B[0m" #define ANSI_HILITE "\x1B[1m" *************** *** 61,66 **** --- 72,78 ---- #define ESC_CHAR '\033' #define ANSI_NORMAL "\033[0m" + #define ANSI_BEGIN "\033[" #define ANSI_HILITE "\033[1m" #define ANSI_INVERSE "\033[7m" *************** *** 95,99 **** --- 107,113 ---- #define ANSI_BWHITE "\033[47m" #endif + + #define ANSI_END "m" #endif /* __ANSI_H */ *** 1_7_4.82/options.h.dist Thu, 29 Mar 2001 15:44:44 -0600 dunemush (pennmush/d/33_options.h. 1.10.1.1.1.1.1.2.1.1.1.1 600) --- 1_7_4.93(w)/options.h.dist Wed, 25 Apr 2001 09:41:55 -0500 dunemush (pennmush/d/33_options.h. 1.10.1.1.1.1.1.2.1.1.1.1.1.1 600) *************** *** 218,232 **** */ /* #define CREATION_TIMES /* */ ! /* The following four options control the semantics of empty and ! * deleted attributes. The configuration recommended for new MUSHes ! * is with all of these options on. Old MUSHes which do not want ! * to port code may want to use only EMPTY_ATTRS; this recreates the ! * pre-1.6.9 behavior. Any configuration with EMPTY_ATTRS but not ! * DUMP_EMPTY_ATTRS is _NOT_ recommmended, with the possible exception ! * of emulating the old behavior. ! * ! * With EMPTY_ATTRS, empty (no value) attributes are retained on * objects, keeping their attribute flags and locked status. * Without this option, such attributes are fully deleted. * Recommended. --- 218,224 ---- */ /* #define CREATION_TIMES /* */ ! /* With EMPTY_ATTRS, empty (no value) attributes are retained on * objects, keeping their attribute flags and locked status. * Without this option, such attributes are fully deleted. * Recommended. *** 1_7_4.82/MANIFEST Mon, 26 Mar 2001 15:18:14 -0600 dunemush (pennmush/d/34_MANIFEST 1.21.1.1 600) --- 1_7_4.93(w)/MANIFEST Thu, 26 Apr 2001 11:19:02 -0500 dunemush (pennmush/d/34_MANIFEST 1.21.1.2 600) *************** *** 135,140 **** --- 135,141 ---- hints/irix.sh hints/linux_2.sh hints/next.sh + hints/openbsd.sh hints/os2.sh hints/solaris_2.sh hints/sunos_4.sh *** 1_7_4.82/src/strtree.c Fri, 02 Feb 2001 15:28:06 -0600 dunemush (pennmush/d/35_strtree.c 1.14 660) --- 1_7_4.93(w)/src/strtree.c Sun, 13 May 2001 08:36:13 -0500 dunemush (pennmush/d/35_strtree.c 1.14.1.1 660) *************** *** 72,79 **** static void st_right_rotate _((int tree_depth, StrNode **root)); static void st_print_tree _((StrNode *node, int tree_depth, int lead)); static void st_traverse_stats ! _( ! (StrNode *node, int *maxdepth, int *mindepth, int *avgdepth, int *leaves, unsigned long *perms, unsigned long *nperms)); void st_stats_header _((dbref player)); --- 72,78 ---- static void st_right_rotate _((int tree_depth, StrNode **root)); static void st_print_tree _((StrNode *node, int tree_depth, int lead)); static void st_traverse_stats ! _((StrNode *node, int *maxdepth, int *mindepth, int *avgdepth, int *leaves, unsigned long *perms, unsigned long *nperms)); void st_stats_header _((dbref player)); *************** *** 590,597 **** } static void st_depth_helper ! _( ! (StrNode *node, int *maxdepth, int *mindepth, int *avgdepth, int *leaves, unsigned long *perms, unsigned long *nperms, int count)); static void st_depth_helper(node, maxdepth, mindepth, avgdepth, leaves, perms, nperms, --- 589,595 ---- } static void st_depth_helper ! _((StrNode *node, int *maxdepth, int *mindepth, int *avgdepth, int *leaves, unsigned long *perms, unsigned long *nperms, int count)); static void st_depth_helper(node, maxdepth, mindepth, avgdepth, leaves, perms, nperms, *** 1_7_4.82/src/pcre.c Fri, 23 Mar 2001 14:12:35 -0600 dunemush (pennmush/d/36_pcre.c 1.4.1.3.1.3.1.1.1.1.1.1 660) --- 1_7_4.93(w)/src/pcre.c Sun, 13 May 2001 08:36:12 -0500 dunemush (pennmush/d/36_pcre.c 1.4.1.3.1.3.1.1.1.1.1.1.1.1 660) *************** *** 2048,2055 **** tempcode = code; if (!compile_regex(options | PCRE_INGROUP, /* Set for all nested groups */ ! ((options & PCRE_IMS) != (newoptions & PCRE_IMS)) ? ! newoptions & PCRE_IMS : -1, /* Pass ims options if changed */ brackets, /* Bracket level */ &tempcode, /* Where to put code (updated) */ &ptr, /* Input pointer (updated) */ --- 2048,2054 ---- tempcode = code; if (!compile_regex(options | PCRE_INGROUP, /* Set for all nested groups */ ! ((options & PCRE_IMS) != (newoptions & PCRE_IMS)) ? newoptions & PCRE_IMS : -1, /* Pass ims options if changed */ brackets, /* Bracket level */ &tempcode, /* Where to put code (updated) */ &ptr, /* Input pointer (updated) */ *************** *** 2489,2503 **** if (op >= OP_BRA || op == OP_ASSERT || op == OP_ONCE || op == OP_COND) { if (!is_anchored(scode, options)) return FALSE; ! } ! else if ((op == OP_TYPESTAR || op == OP_TYPEMINSTAR) && (*options & PCRE_DOTALL) != 0) { if (scode[1] != OP_ANY) return FALSE; ! } ! else if (op != OP_SOD && ((*options & PCRE_MULTILINE) != 0 || op != OP_CIRC)) ! return FALSE; code += (code[1] << 8) + code[2]; } while (*code == OP_ALT); --- 2488,2500 ---- if (op >= OP_BRA || op == OP_ASSERT || op == OP_ONCE || op == OP_COND) { if (!is_anchored(scode, options)) return FALSE; ! } else if ((op == OP_TYPESTAR || op == OP_TYPEMINSTAR) && (*options & PCRE_DOTALL) != 0) { if (scode[1] != OP_ANY) return FALSE; ! } else if (op != OP_SOD && ((*options & PCRE_MULTILINE) != 0 || op != OP_CIRC)) ! return FALSE; code += (code[1] << 8) + code[2]; } while (*code == OP_ALT); *************** *** 2694,2701 **** /* Reflect pattern for debugging output */ ! DPRINTF( ! ("------------------------------------------------------------------\n")); DPRINTF(("%s\n", pattern)); /* The first thing to do is to make a pass over the pattern to compute the --- 2691,2697 ---- /* Reflect pattern for debugging output */ ! DPRINTF(("------------------------------------------------------------------\n")); DPRINTF(("%s\n", pattern)); /* The first thing to do is to make a pass over the pattern to compute the *************** *** 3038,3045 **** END_OPTIONS: if (c == ')') { if (branch_newextra == 2 ! && (branch_extra == 0 ! || branch_extra == 3)) branch_extra += branch_newextra; continue; } --- 3034,3041 ---- END_OPTIONS: if (c == ')') { if (branch_newextra == 2 ! && (branch_extra == 0 || branch_extra == 3)) ! branch_extra += branch_newextra; continue; } *************** *** 3721,3728 **** int save_offset2 = md->offset_vector[offset +