[PENNMUSH-ANNOUNCE] 1.7.5-patch05
dunemush@pennmush.org
dunemush at pennmush.org
Mon, 25 Mar 2002 10:58:56 -0600
This is patch05 to PennMUSH 1.7.5. After applying this patch, you will
have version 1.7.5p5
To apply this patch, save it to a file in your top-level MUSH directory,
and do the following:
patch -p1 < 1.7.5-patch05
make install
If you use GNU patch 2.2, you probably want the above to be 'patch -b -p1',
not just 'patch -p1'.
Unix (or cygwin) users need not worry about failed hunks in src/switchinc.c,
hdrs/switches.h, hdrs/cmds.h, or hdrs/funs.h. These files are automatically
rebuilt on compile.
Then @shutdown and restart your MUSH.
- Alan/Javelin
In this patch:
Commands:
* @notify and @drain now accept a new switch /any. [TAP]
* Added @remit/list. Suggested by Tareldin@M*U*S*H [SW]
Minor changes:
* We now use the Mersenne Twister pseudo-random number generator,
which is better that that available in most C libraries.
Moreover, we seed with /dev/urandom, if it's available. [SW]
* The 'T' type character (for THING) is now shown when one-character
flag lists are displayed. This is more consistent with other types,
and makes it harder to confuse #23O (#23, opaque) with #230
(#230, no flags). Suggested by Eratl@M*U*S*H.
* @lock/use on a parent used to apply to attempts to use $commands on
a child. This is no longer necessary, given inheritable locks,
so the behavior has been changed. Parents' locks are no longer checked
when deciding if a $command inherited from the parent should be run
via a child.
* New 'call_limit' config option can limit the number of recursive
parser calls to control process stack size and avoid crashes
on systems with limited stack. Defaults to unlimited, however, because
setting this value too small breaks mushcode. Report by Bellemore
and BladedThoth @ M*U*S*H.
Fixes:
* Code cleanup - some stuff from 1.7.4 got left in that isn't
used in 1.7.5 any more. [SW]
* Fixes from 1.7.4p16, notably an important fix for timed semaphores.
* Cygwin portability fixes. [NJG]
* Updated MSVC++ project files. [EEH]
Prereq: 1.7.5p4
*** 1_7_5.98/Patchlevel Fri, 15 Feb 2002 16:15:40 -0600 dunemush (pennmush/5_Patchlevel 1.17.1.5 600)
--- 1_7_5.133(w)/Patchlevel Mon, 11 Mar 2002 18:21:31 -0600 dunemush (pennmush/5_Patchlevel 1.17.1.6 600)
***************
*** 1,2 ****
Do not edit this file. It is maintained by the official PennMUSH patches.
! This is PennMUSH 1.7.5p4
--- 1,2 ----
Do not edit this file. It is maintained by the official PennMUSH patches.
! This is PennMUSH 1.7.5p5
*** 1_7_5.98/CHANGES.174 Sun, 10 Feb 2002 09:30:30 -0600 dunemush (pennmush/8_CHANGES 1.219.1.72.1.1 600)
--- 1_7_5.133(w)/CHANGES.174 Sun, 17 Mar 2002 09:39:37 -0600 dunemush (pennmush/8_CHANGES 1.219.1.72.1.21 600)
***************
*** 18,23 ****
--- 18,71 ----
==========================================================================
+ Version 1.7.4 patchlevel 16 March 11, 2002
+
+ Minor changes:
+ * After using 'register' at the connect screen, the player is
+ no longer disconnected. Suggested by Philip Mak.
+ * 'help mail functions'. Suggested by Trispis@M*U*S*H.
+ * Messages associated with drop, give, and get are now more
+ verbose and provide more information about who did what to whom.
+ Suggested by Philip Mak.
+ * Attrib locks did case-sensitive comparison of values, which is not
+ what you probably want. No longer. Reported by Philip Mak. [SW]
+ * QUEUE and sempahore attributes are now removed (not just emptied)
+ when drained or notified to 0. [TAP]
+ Fixes:
+ * Improvements in handling ansi in string functions. [SW]
+ * @clone/preserve didn't preserve when cloning exits. Reported by
+ Bellemore@M*U*S*H. [SW]
+ * A significant bug in the manual notification of timed semaphores has
+ been corrected. [SW]
+ * Revian@M*U*S*H pointed out that user-defined commands starting with
+ "@" that match the names of standard attributes don't behave as
+ you might expect. This is now documented in help user-defined commands.
+ * Security checks for attribute setting used the owner of the setting
+ object, not the setting object itself. Report by Howie@New Frontier.
+ * help set() improved based on report by Tareldin@M*U*S*H.
+ * folderstats() did not behave as promised in the help. Now it
+ does. Report by Trispis@M*U*S*H.
+ * Typo in src/log.c fixed by Nathan Schuette.
+ * Improved help for DEBUG. [SW]
+ * Aliased 'help ^' to 'help listening2'. Suggested by Philip Mak.
+ * MacOS portability fixes. [DW]
+ * The sigusr1 handler would reinstall itself as the sighup handler
+ on systems that don't provide persistent signals.
+ Fixed by Bellemore@M*U*S*H.
+ * &a=b me now properly clears the attribute A=B. Reported by
+ Trispis@M*U*S*H. In addition, now @tel #1234= produces an error,
+ as it should. [SW]
+ * mail functions can now be called by an object on anything it controls
+ (typically, its owner). Suggested by Trispis@M*U*S*H.
+ * The givee is now correctly passed in %1 to @give/@ogive/@agive,
+ and documented. Reported by Philip Mak.
+ * Added hints for Irix 6.x by Vexon@M*U*S*H.
+ * i18n fix for function invocation limit message.
+ * Clarification in help @alias by Philip Mak.
+ * @set obj=!puppet repeatedly no longer repeats the "not listening"
+ message. Reported by Philip Mak.
+
+
Version 1.7.4 patchlevel 15 February 8, 2002
Minor Changes:
***************
*** 177,186 ****
* Improved failure message for @password. Suggested by Mike Wesson. [SW]
* alphamin()/alphamax() were stripping markup from what they returned. [SW]
* PARANOID flag is now only visible to owners. Reported by
! Bellemore@BelleMUSH.
* Improved error message when trying to rejoin a channel. [SW]
* In Win32 NT_TCP mode, ident lookups are now done and the LASTIP
! attribute doesn't get corrupted. Patch by Bellemore@BelleMUSH.
* @chan/describe now works along with @chan/desc. Suggested by
Trispis@M*U*S*H
* 'teach'ing a motion to a follower didn't work right. Reported by
--- 225,234 ----
* Improved failure message for @password. Suggested by Mike Wesson. [SW]
* alphamin()/alphamax() were stripping markup from what they returned. [SW]
* PARANOID flag is now only visible to owners. Reported by
! Bellemore@M*U*S*H.
* Improved error message when trying to rejoin a channel. [SW]
* In Win32 NT_TCP mode, ident lookups are now done and the LASTIP
! attribute doesn't get corrupted. Patch by Bellemore@M*U*S*H.
* @chan/describe now works along with @chan/desc. Suggested by
Trispis@M*U*S*H
* 'teach'ing a motion to a follower didn't work right. Reported by
*** 1_7_5.98/CHANGES Fri, 15 Feb 2002 16:15:40 -0600 dunemush (pennmush/g/7_CHANGES 1.27.1.2 600)
--- 1_7_5.133(w)/CHANGES Thu, 14 Mar 2002 09:14:37 -0600 dunemush (pennmush/g/7_CHANGES 1.27.1.12 600)
***************
*** 10,21 ****
--- 10,53 ----
[LdW] is Luuk de Waard, a PennMUSH developer (aka Halatir)
[RLM] is Ralph Melton, a former PennMUSH developer
[NJG] is Nick Gammon, the Win32 porter
+ [EEH] is Ervin Hearn III, a Win32 porter (aka Noltar)
[DW] is Dan Williams, the MacOS porter
[2.2] refers to code which originated with the TinyMUSH 2.2 developers
[3] refers to code by (or inspired by) TinyMUSH 3.0
[Rhost] refers to code by (or inspired by) RhostMUSH
==========================================================================
+
+ Version 1.7.5 patchlevel 5 March 11, 2002
+
+ Commands:
+ * @notify and @drain now accept a new switch /any. [TAP]
+ * Added @remit/list. Suggested by Tareldin@M*U*S*H [SW]
+ Minor changes:
+ * We now use the Mersenne Twister pseudo-random number generator,
+ which is better that that available in most C libraries.
+ Moreover, we seed with /dev/urandom, if it's available. [SW]
+ * The 'T' type character (for THING) is now shown when one-character
+ flag lists are displayed. This is more consistent with other types,
+ and makes it harder to confuse #23O (#23, opaque) with #230
+ (#230, no flags). Suggested by Eratl@M*U*S*H.
+ * @lock/use on a parent used to apply to attempts to use $commands on
+ a child. This is no longer necessary, given inheritable locks,
+ so the behavior has been changed. Parents' locks are no longer checked
+ when deciding if a $command inherited from the parent should be run
+ via a child.
+ * New 'call_limit' config option can limit the number of recursive
+ parser calls to control process stack size and avoid crashes
+ on systems with limited stack. Defaults to unlimited, however, because
+ setting this value too small breaks mushcode. Report by Bellemore
+ and BladedThoth @ M*U*S*H.
+ Fixes:
+ * Code cleanup - some stuff from 1.7.4 got left in that isn't
+ used in 1.7.5 any more. [SW]
+ * Fixes from 1.7.4p16, notably an important fix for timed semaphores.
+ * Cygwin portability fixes. [NJG]
+ * Updated MSVC++ project files. [EEH]
+
Version 1.7.5 patchlevel 4 February 15, 2002
*** 1_7_5.98/game/txt/hlp/pennvers.hlp Fri, 15 Feb 2002 16:15:40 -0600 dunemush (pennmush/12_pennvers.h 1.169.1.42.1.3.1.5 600)
--- 1_7_5.133(w)/game/txt/hlp/pennvers.hlp Tue, 19 Mar 2002 08:58:24 -0600 dunemush (pennmush/12_pennvers.h 1.169.1.42.1.3.1.2.2.2.1.1.1.3.1.1 600)
***************
*** 1,5 ****
& changes
! & 1.7.5p4
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 <name of whatever>'. 'help credits'
--- 1,5 ----
& changes
! & 1.7.5p5
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 <name of whatever>'. 'help credits'
***************
*** 11,16 ****
--- 11,48 ----
A list of the patchlevels associated with each release can
be read in 'help patchlevels'.
+ Version 1.7.5 patchlevel 5 March 11, 2002
+
+ Commands:
+ * @notify and @drain now accept a new switch /any. [TAP]
+ * Added @remit/list. Suggested by Tareldin@M*U*S*H [SW]
+ Minor changes:
+ * We now use the Mersenne Twister pseudo-random number generator,
+ which is better that that available in most C libraries.
+ Moreover, we seed with /dev/urandom, if it's available. [SW]
+ * The 'T' type character (for THING) is now shown when one-character
+ flag lists are displayed. This is more consistent with other types,
+ and makes it harder to confuse #23O (#23, opaque) with #230
+ (#230, no flags). Suggested by Eratl@M*U*S*H.
+ * @lock/use on a parent used to apply to attempts to use $commands on
+ a child. This is no longer necessary, given inheritable locks,
+ so the behavior has been changed. Parents' locks are no longer checked
+ when deciding if a $command inherited from the parent should be run
+ via a child.
+ * New 'call_limit' config option can limit the number of recursive
+ parser calls to control process stack size and avoid crashes
+ on systems with limited stack. Defaults to unlimited, however, because
+ setting this value too small breaks mushcode. Report by Bellemore
+ and BladedThoth @ M*U*S*H.
+ Fixes:
+ * Code cleanup - some stuff from 1.7.4 got left in that isn't
+ used in 1.7.5 any more. [SW]
+ * Fixes from 1.7.4p16, notably an important fix for timed semaphores.
+ * Cygwin portability fixes. [NJG]
+ * Updated MSVC++ project files. [EEH]
+
+
+ & 1.7.5p4
Version 1.7.5 patchlevel 4 February 15, 2002
Major changes:
***************
*** 157,162 ****
--- 189,243 ----
* Indentation fixes [SW]
* Fixes up to 1.7.4p12 merged in.
+ & 1.7.4p16
+ Version 1.7.4 patchlevel 16 March 11, 2002
+
+ Minor changes:
+ * After using 'register' at the connect screen, the player is
+ no longer disconnected. Suggested by Philip Mak.
+ * 'help mail functions'. Suggested by Trispis@M*U*S*H.
+ * Messages associated with drop, give, and get are now more
+ verbose and provide more information about who did what to whom.
+ Suggested by Philip Mak.
+ * Attrib locks did case-sensitive comparison of values, which is not
+ what you probably want. No longer. Reported by Philip Mak. [SW]
+ * QUEUE and sempahore attributes are now removed (not just emptied)
+ when drained or notified to 0. [TAP]
+ Fixes:
+ * Improvements in handling ansi in string functions. [SW]
+ * @clone/preserve didn't preserve when cloning exits. Reported by
+ Bellemore@M*U*S*H. [SW]
+ * A significant bug in the manual notification of timed semaphores has
+ been corrected. [SW]
+ * Revian@M*U*S*H pointed out that user-defined commands starting with
+ "@" that match the names of standard attributes don't behave as
+ you might expect. This is now documented in help user-defined commands.
+ * Security checks for attribute setting used the owner of the setting
+ object, not the setting object itself. Report by Howie@New Frontier.
+ * help set() improved based on report by Tareldin@M*U*S*H.
+ * folderstats() did not behave as promised in the help. Now it
+ does. Report by Trispis@M*U*S*H.
+ * Typo in src/log.c fixed by Nathan Schuette.
+ * Improved help for DEBUG. [SW]
+ * Aliased 'help ^' to 'help listening2'. Suggested by Philip Mak.
+ * MacOS portability fixes. [DW]
+ * The sigusr1 handler would reinstall itself as the sighup handler
+ on systems that don't provide persistent signals.
+ Fixed by Bellemore@M*U*S*H.
+ * &a=b me now properly clears the attribute A=B. Reported by
+ Trispis@M*U*S*H. In addition, now @tel #1234= produces an error,
+ as it should. [SW]
+ * mail functions can now be called by an object on anything it controls
+ (typically, its owner). Suggested by Trispis@M*U*S*H.
+ * The givee is now correctly passed in %1 to @give/@ogive/@agive,
+ and documented. Reported by Philip Mak.
+ * Added hints for Irix 6.x by Vexon@M*U*S*H.
+ * i18n fix for function invocation limit message.
+ * Clarification in help @alias by Philip Mak.
+ * @set obj=!puppet repeatedly no longer repeats the "not listening"
+ message. Reported by Philip Mak.
+
+
& 1.7.4p15
Version 1.7.4 patchlevel 15 February 8, 2002
***************
*** 323,332 ****
* Improved failure message for @password. Suggested by Mike Wesson. [SW]
* alphamin()/alphamax() were stripping markup from what they returned. [SW]
* PARANOID flag is now only visible to owners. Reported by
! Bellemore@BelleMUSH.
* Improved error message when trying to rejoin a channel. [SW]
* In Win32 NT_TCP mode, ident lookups are now done and the LASTIP
! attribute doesn't get corrupted. Patch by Bellemore@BelleMUSH.
* @chan/describe now works along with @chan/desc. Suggested by
Trispis@M*U*S*H
* 'teach'ing a motion to a follower didn't work right. Reported by
--- 404,413 ----
* Improved failure message for @password. Suggested by Mike Wesson. [SW]
* alphamin()/alphamax() were stripping markup from what they returned. [SW]
* PARANOID flag is now only visible to owners. Reported by
! Bellemore@M*U*S*H.
* Improved error message when trying to rejoin a channel. [SW]
* In Win32 NT_TCP mode, ident lookups are now done and the LASTIP
! attribute doesn't get corrupted. Patch by Bellemore@M*U*S*H.
* @chan/describe now works along with @chan/desc. Suggested by
Trispis@M*U*S*H
* 'teach'ing a motion to a follower didn't work right. Reported by
***************
*** 5125,5132 ****
For information on a specific patchlevel of one of the versions listed,
type 'help <version>p<patchlevel>'. For example, 'help 1.7.2p3'
! 1.7.5: 0, 1, 2, 3, 4
! 1.7.4: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
1.7.3: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
1.7.2: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35
--- 5206,5213 ----
For information on a specific patchlevel of one of the versions listed,
type 'help <version>p<patchlevel>'. For example, 'help 1.7.2p3'
! 1.7.5: 0, 1, 2, 3, 4, 5
! 1.7.4: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
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_5.98/game/txt/hlp/penntop.hlp Sat, 09 Feb 2002 15:14:06 -0600 dunemush (pennmush/13_penntop.hl 1.2.1.27.1.3.1.2.1.2.1.4 600)
--- 1_7_5.133(w)/game/txt/hlp/penntop.hlp Mon, 11 Mar 2002 18:14:39 -0600 dunemush (pennmush/13_penntop.hl 1.2.1.27.1.3.1.2.1.2.1.1.1.1.1.2 600)
***************
*** 354,360 ****
Maintainer: Javelin
Developers: Talek [TAP], Trivian [TN], Halatir [LdW], Raevnos [SW]
Porters: Nick Gammon [NJG] (win32), Dan Williams [DW] (MacOS),
! Sylvia (OS/2), Ervin Hearn III [EH] (win32)
Former devteam: Rhyanna [RLM]
The original TinyMUSH 1.0 code was written by Lawrence Foard, and was
--- 354,360 ----
Maintainer: Javelin
Developers: Talek [TAP], Trivian [TN], Halatir [LdW], Raevnos [SW]
Porters: Nick Gammon [NJG] (win32), Dan Williams [DW] (MacOS),
! Sylvia (OS/2), Ervin Hearn III [EEH] (win32)
Former devteam: Rhyanna [RLM]
The original TinyMUSH 1.0 code was written by Lawrence Foard, and was
***************
*** 676,681 ****
--- 676,682 ----
Welcome Mat says, "Welcome, Breaker!"
(continued in help listening2)
+ & ^
& LISTENING2
If you need an object to "listen" for more than one pattern, you can
also use ^-patterns. These work similar to user-defined commands,
***************
*** 1570,1576 ****
& $-COMMANDS
& MACROS
& USER-DEFINED COMMANDS
-
User-defined commands can be created by setting $-commands on players,
things, and rooms. Exits cannot have $-commands. To set a $-command:
--- 1571,1576 ----
***************
*** 1584,1589 ****
--- 1584,1594 ----
Such attributes can also be @triggered as if the $<command name>:
did not exist.
+
+ It is recommended that <command name> not begin with "@", as the
+ command parser treats @ specially and may cause your command to fail
+ if the name might also match an attribute name. Conventionally,
+ global commands are often named with the "+" prefix.
(continued in help user-defined2)
& $-COMMANDS2
*** 1_7_5.98/game/txt/hlp/pennfunc.hlp Sun, 10 Feb 2002 11:38:52 -0600 dunemush (pennmush/16_pennfunc.h 1.2.1.50.1.1.1.1.1.2.1.7.1.8.1.1.1.1.1.1.1.1.1.3 600)
--- 1_7_5.133(w)/game/txt/hlp/pennfunc.hlp Mon, 11 Mar 2002 18:18:09 -0600 dunemush (pennmush/16_pennfunc.h 1.2.1.50.1.1.1.1.1.2.1.7.1.8.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1 600)
***************
*** 47,52 ****
--- 47,53 ----
Global functions: local MUSH-specific functions defined with @function
Information functions: find out something about objects (FLAGS, MONEY)
List functions: manipulate lists (REVWORDS, FIRST)
+ Mail functions: manipulate @mail (MAIL, FOLDERSTATS)
Math functions: number manipulation, generic or integers only (ADD, DIV)
Regular expression functions: Regular expressions (REGMATCH, REGEDIT)
String functions: string manipulation (ESCAPE, FLIP)
***************
*** 102,120 ****
See also: DBREF
& Information functions
! Information functions return values related to objects, channels,
! or mail.
andflags() cflags() channels() clock() config()
conn() controls() ctime() ctitle() cwho()
! doing() elock() findable() flags() folderstats()
! fullname() hasattr() hasattrp() hasflag() haspower()
! hastype() hidden() idle() iname() lock()
! lstats() lwho() mail() mailfrom() mailsubject()
! mailstats() mailstatus() mailtime() money() mtime()
! mwho() name() nattr() nearby() objmem()
! orflags() playermem() poll() ports() powers()
! quota() type() visible()
& Floating point functions
Floating point functions operate on floating point numbers. Most of
--- 103,125 ----
See also: DBREF
& Information functions
! Information functions return values related to objects or channels.
andflags() cflags() channels() clock() config()
conn() controls() ctime() ctitle() cwho()
! doing() elock() findable() flags() fullname()
! hasattr() hasattrp() hasflag() haspower() hastype()
! hidden() idle() iname() lock() lstats()
! lwho() money() mtime() mwho() name()
! nattr() nearby() objmem() orflags() playermem()
! poll() ports() powers() quota() type()
! visible()
!
! & Mail functions
! Mail functions work with @mail.
!
! folderstats() mail() maildstats() mailfrom() mailfstats()
! mailstats() mailstatus() mailsubject() mailtime()
& Floating point functions
Floating point functions operate on floating point numbers. Most of
***************
*** 2635,2646 ****
See also: ESCAPE()
& SET()
! set(<name>, <string>)
This function is equivalent to @set, and can be used to switch
! flags, set attributes, and many other things. The <name> and
! <string> fields correspond to the stuff before and after the '='
! in @set. This function returns nothing.
Note that you can't clear an attribute with set(), though
you can make it an empty attribute. Use wipe() to clear attributes.
--- 2640,2653 ----
See also: ESCAPE()
& SET()
! set(<object>, <flag>)
! set(<object>/<attribute>, <attribute flag>)
! set(<object>, <attribute>:<value>)
This function is equivalent to @set, and can be used to switch
! flags, set attributes, and many other things. The two arguments
! to the function are the same as the arguments that would appear
! on either side of the '=' in @set. This function returns nothing.
Note that you can't clear an attribute with set(), though
you can make it an empty attribute. Use wipe() to clear attributes.
*** 1_7_5.98/game/txt/hlp/pennflag.hlp Sun, 27 Jan 2002 16:28:10 -0600 dunemush (pennmush/17_pennflag.h 1.1.1.1.1.2.1.1.1.2.1.1.1.2.1.1.2.1.2.3 600)
--- 1_7_5.133(w)/game/txt/hlp/pennflag.hlp Mon, 11 Mar 2002 18:14:40 -0600 dunemush (pennmush/17_pennflag.h 1.1.1.1.1.2.1.1.1.2.1.1.1.2.1.1.2.1.2.1.1.2 600)
***************
*** 197,203 ****
The DEBUG flag is used for debugging MUSHcode. It is meant to be used
in conjunction with the VERBOSE flag. If an object is set DEBUG, all
parser evaluation results will be shown to the object's owner, in the
! format: #<object dbref>! <string to evaluate> => <evaluated string>
Note that verbose output is "#obj]" - debug output is "#obj!".
Because the parser does recursive evaluations, you will see successive
--- 197,208 ----
The DEBUG flag is used for debugging MUSHcode. It is meant to be used
in conjunction with the VERBOSE flag. If an object is set DEBUG, all
parser evaluation results will be shown to the object's owner, in the
! format:
!
! #dbref! <string to evaluate> :
! #dbref! recursive evaluation of functions in string
! #dbref! <string to evaluate> => <evaluated string>
!
Note that verbose output is "#obj]" - debug output is "#obj!".
Because the parser does recursive evaluations, you will see successive
***************
*** 205,216 ****
to pinpoint exactly which evaluation is going wrong.
Objects run under this flag are computationally expensive.
! Avoid leaving it set on objects.
!
! During a DEBUG evaluation, the flag is temporarily reset; therefore,
! a test for HASFLAG(), FLAGS(), etc. in the debug execution will show
! that the DEBUG flag is not set (although the actual output will be
! correct.)
See "help DEBUG2" for more.
& DEBUG2
--- 210,217 ----
to pinpoint exactly which evaluation is going wrong.
Objects run under this flag are computationally expensive.
! Avoid leaving it set on objects. It can also generate huge amounts of
! spam from the output.
See "help DEBUG2" for more.
& DEBUG2
***************
*** 219,230 ****
> @va test=$wc *:"String %0 has [strlen(%0)] letters and [words(%0)] words.
> wc This is my test string
! #14! String %0 has [strlen(%0)] letters and [words(%0)] words. => String
! This is my test string has 22 letters and 5 words.
! #14! strlen(%0) => 22
! #14! %0 => This is my test string
! #14! words(%0) => 5
! #14! %0 => This is my test string
Test says, "String This is my test string has 22 letters and 5 words."
& DESTROY_OK
Flag: DESTROY_OK (things)
--- 220,234 ----
> @va test=$wc *:"String %0 has [strlen(%0)] letters and [words(%0)] words.
> wc This is my test string
! #14! String %0 has [strlen(%0)] letters and [words(%0)] words. :
! #14! strlen(%0) :
! #14! %0 => This is my test string
! #14! strlen(%0) => 22
! #14! words(%0) :
! #14! %0 => This is my test string
! #14! words(%0) => 5
! #14! String %0 has [strlen(%0)] letters and [words(%0)] words. =>
! String This is my test string has 22 letters and 5 words.
Test says, "String This is my test string has 22 letters and 5 words."
& DESTROY_OK
Flag: DESTROY_OK (things)
*** 1_7_5.98/game/txt/hlp/penncmd.hlp Wed, 06 Feb 2002 22:46:48 -0600 dunemush (pennmush/18_penncmd.hl 1.2.1.1.1.47.1.1.1.1.1.3.1.4.1.1.1.1.1.6 600)
--- 1_7_5.133(w)/game/txt/hlp/penncmd.hlp Sun, 17 Mar 2002 09:39:39 -0600 dunemush (pennmush/18_penncmd.hl 1.2.1.1.1.47.1.1.1.1.1.3.1.4.1.1.1.1.1.1.1.1.1.1.1.2 600)
***************
*** 261,266 ****
--- 261,268 ----
Aliases cannot be longer than the limit allowed for player names,
cannot contain spaces, and must be unique -- no other player may
have the same alias or name as any other player's alias or name.
+
+ @alias has no effect on non-players.
& @allhalt
@allhalt
***************
*** 854,866 ****
Example: @dolist [lcon(here)] = "[name(##)]
would cause you to say the name of all objects in the room.
& @drain
! @drain <object>[/<attribute>]
!
! This command discards all commands waiting on the semaphore <object>
! and resets the semaphore to its initial state (clearing the SEMAPHORE
! attribute, or the one specified). The pending commands are removed
! from the queue without being executed.
See also the help for: SEMAPHORES, @notify, @wait
& @drop
@drop <object> [=<message>]. <object> can be a thing, player, exit,
--- 856,879 ----
Example: @dolist [lcon(here)] = "[name(##)]
would cause you to say the name of all objects in the room.
& @drain
! @drain[/any][/all] <object>[/<attribute>][=<number>]
+ This command discards commands waiting on a semaphore without
+ executing them.
+
+ If the /any switch is given, then all semaphores associated with
+ <object> are @drained. Otherwise, the only the specified semaphore
+ attribute (or SEMAPHORE if no attribute is specified) is @drained.
+
+ If the /all switch is given, then all queue entries associated
+ with the selected semaphore(s) are discarded, and the semaphore
+ attribute(s) are cleared. Otherwise, only the indicated <number>
+ of queue entries are discarded. If no <number> is given, then
+ the /all switch is assumed.
+
+ You may not specify both the /any switch and a specific attribute.
+ Similarly, you may not specify both the /all switch and a number.
+
See also the help for: SEMAPHORES, @notify, @wait
& @drop
@drop <object> [=<message>]. <object> can be a thing, player, exit,
***************
*** 1896,1913 ****
See also: @password
& @notify
! @notify[/all] <object>[/<attribute>][=<count>]
! This command notifies the semaphore <object>, running the first
! command that waited on <object> using the semaphore version of
! @wait. If <count> is specified, it notifies the semaphore that
! many times. If there are no commands, or less than <count>
! commands, pending for <object>, then subsequent @waits will not
! block until the semaphore count reaches zero again.
!
! The "/all" switch to this command notifies the semaphore until
! the semaphore count is exactly zero; all commands pending on that
! semaphore are executed immediately. <count> is ignored.
See also: SEMAPHORES, @drain, @wait
& @odeath
--- 1909,1935 ----
See also: @password
& @notify
! @notify[/any][/all] <object>[/<attribute>][=<count>]
!
! This command notifies a semaphore, allowing commands queued for
! that semaphore to be executed.
!
! If the /any switch is given, then all semaphores associated with
! <object> are @notified. Otherwise, the only the specified semaphore
! attribute (or SEMAPHORE if no attribute is specified) is @notified.
!
! If the /all switch is given, then all queue entries associated
! with the selected semaphore(s) are executed. Otherwise, only the
! first <number> of queue entries are run. If no <number> is given,
! then only one queue entry is run.
!
! If the /all switch was not used, and there were not enough queue
! entries waiting to satisfy the requested <number> (or 1, if no
! number was given), then subsequent @waits will not block until
! the requested <number> have been run.
! You may not specify both the /any switch and a specific attribute.
! Similarly, you may not specify both the /all switch and a number.
See also: SEMAPHORES, @drain, @wait
& @odeath
***************
*** 2229,2237 ****
@give sets the message that is shown to the giver when giving an object
to someone else. @ogive is a message shown to others in the giver's
location, and @agive is an action run by the giver. If not set,
! the giver gets a default message ("Given.")
%0 will be set to the dbref of the object given.
See also: give
& @pcreate
--- 2251,2260 ----
@give sets the message that is shown to the giver when giving an object
to someone else. @ogive is a message shown to others in the giver's
location, and @agive is an action run by the giver. If not set,
! the giver gets a default message.
%0 will be set to the dbref of the object given.
+ %1 will be set to the dbref of the recipient.
See also: give
& @pcreate
***************
*** 2356,2368 ****
See also: @motd, @list, @listmotd
& @remit
! @remit[/noeval][/silent] <object> = <message>.
Sends the message to all contents of <object>, which can be a room,
thing, or player. (The TinyMUSH equivalent is @pemit/contents).
! The /noeval switch prevents the MUSH from evaluating the message.
! The /silent switch stops the remitter from being notified.
See also: @emit, @pemit, @oemit, SPOOFING, NOSPOOF and CONTROL.
& @restart
--- 2379,2397 ----
See also: @motd, @list, @listmotd
& @remit
! @remit[/switches] <object> = <message>.
Sends the message to all contents of <object>, which can be a room,
thing, or player. (The TinyMUSH equivalent is @pemit/contents).
! The /silent switch stops the remitter from getting feedback if they're
! in a different location than the target.
! The /noisy switch always gives feedback to the remitter if they are
! not in the target location. Without /silent or /noisy, the silent_pemit
! config option is used to determine noisiness.
! The /list switch will send the message to the contents of multiple
! objects at the same time. The <OBJECT> argument is treated as a
! space-separated list of targets.
See also: @emit, @pemit, @oemit, SPOOFING, NOSPOOF and CONTROL.
& @restart
*** 1_7_5.98/game/mushcnf.dst Mon, 26 Nov 2001 17:23:06 -0600 dunemush (pennmush/41_mushcnf.ds 1.1.1.19.1.1.1.2.1.6 600)
--- 1_7_5.133(w)/game/mushcnf.dst Thu, 14 Mar 2002 09:15:04 -0600 dunemush (pennmush/41_mushcnf.ds 1.1.1.19.1.1.1.2.1.1.1.5 600)
***************
*** 26,32 ****
# Should the MUSH attempt to resolve IP numbers to hostnames?
# If yes, you'll see hostnames on the wizard WHO. If no, IP numbers.
# No makes sense if you're running PennMUSH at home and don't have
! # a DNS server you can access.
use_dns yes
# Databases
--- 26,32 ----
# Should the MUSH attempt to resolve IP numbers to hostnames?
# If yes, you'll see hostnames on the wizard WHO. If no, IP numbers.
# No makes sense if you're running PennMUSH at home and don't have
! # a DNS server you can access. MacOS 7/8/9 should use 'no'
use_dns yes
# Databases
***************
*** 54,60 ****
#
# Most people can just use one of the following:
#
! # Use these 3 lines for no compression. Required on win32.
#compress_program
#uncompress_program
#compress_suffix
--- 54,60 ----
#
# Most people can just use one of the following:
#
! # Use these 3 lines for no compression. Required on win32 and MacOS 7/8/9.
#compress_program
#uncompress_program
#compress_suffix
***************
*** 155,160 ****
--- 155,169 ----
# the maximum number of functions that can be invoked
function_invocation_limit 2500
+
+ # the maximum number of times we're allowed to recursively call the parser
+ # for a single expression. This limits how much the stack size can increase,
+ # which could be useful if your host limits your stack (it will prevent
+ # a crash).
+ # But remember that you need to recurse for every [ or { or function call
+ # in your code, and those add up quickly. So this must often be set quite
+ # high (e.g. 18000), alas. Setting it to '0' means unlimited.
+ call_limit 0
# How many channels total can be created?
# This doesn't allocate memory, it just sets a maximum.
*** 1_7_5.98/hints/win32-gcc.sh Fri, 15 Feb 2002 08:37:53 -0600 dunemush (pennmush/b/0_win32-gcc. 1.3 600)
--- 1_7_5.133(w)/hints/win32-gcc.sh Sat, 23 Feb 2002 14:45:40 -0600 dunemush (pennmush/b/0_win32-gcc. 1.4 600)
***************
*** 4,6 ****
--- 4,7 ----
usenm='n'
h_fcntl='false'
d_ipv6='undef'
+ d_setlocale='undef'
*** 1_7_5.98/config_h.SH Fri, 15 Feb 2002 16:56:28 -0600 dunemush (pennmush/b/17_config_h.S 1.17.1.2.1.4 660)
--- 1_7_5.133(w)/config_h.SH Mon, 11 Mar 2002 18:20:07 -0600 dunemush (pennmush/b/17_config_h.S 1.17.1.2.1.5 660)
***************
*** 725,730 ****
--- 725,735 ----
#$d_uptime HAS_UPTIME /**/
#define UPTIME_PATH "$uptime"
+ /* HAS_DEV_URANDOM:
+ * This symbol is defined if /dev/urandom is available.
+ */
+ #$d_urandom HAS_DEV_URANDOM /**/
+
/* UNION_WAIT:
* This symbol if defined indicates to the C program that the argument
* for the wait() system call should be declared as 'union wait status'
*** 1_7_5.98/src/SWITCHES Wed, 07 Nov 2001 19:39:04 -0600 dunemush (pennmush/b/22_SWITCHES 1.12.1.1 600)
--- 1_7_5.133(w)/src/SWITCHES Sat, 23 Feb 2002 14:31:39 -0600 dunemush (pennmush/b/22_SWITCHES 1.12.1.2 600)
***************
*** 1,6 ****
--- 1,7 ----
ACCESS
ADD
ALL
+ ANY
ATTRIBS
BAN
BLIND
*** 1_7_5.98/src/utils.c Fri, 15 Feb 2002 08:37:53 -0600 dunemush (pennmush/b/27_utils.c 1.32 660)
--- 1_7_5.133(w)/src/utils.c Tue, 19 Mar 2002 09:58:48 -0600 dunemush (pennmush/b/27_utils.c 1.34 660)
***************
*** 8,24 ****
#ifdef sgi
#include <math.h>
#endif
- #ifdef I_STDLIB
#include <stdlib.h>
- #endif
- #ifdef I_STRING
#include <string.h>
- #else
- #include <strings.h>
- #endif
#include <ctype.h>
!
!
#include "conf.h"
#ifdef MEM_CHECK
--- 8,30 ----
#ifdef sgi
#include <math.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
! #include <time.h>
! #ifdef I_SYS_TYPES
! #include <sys/types.h>
! #endif
! #ifdef I_SYS_STAT
! #include <sys/stat.h>
! #endif
! #define I_FCNTL
! #ifdef I_FCNTL
! #include <fcntl.h>
! #endif
! #ifdef I_UNISTD
! #include <unistd.h>
! #endif
#include "conf.h"
#ifdef MEM_CHECK
***************
*** 236,278 ****
}
! #ifndef RAND_MAX /* Yes, RAND_MAX is not portable */
! #define RAND_MAX LONG_MAX
#endif
long
! get_random_long(low, high)
! long low;
! long high;
! {
! long range = high - low + 1;
! long num;
! long span;
! if (low > high)
return 0;
! for (;;) {
! num = 0;
! high = 1;
! while (high < range) {
! num = (num + 1) * random();
! if (high > LONG_MAX / RAND_MAX)
! high = LONG_MAX;
! else
! high *= RAND_MAX;
! }
! span = high / range;
! if (num < span * range)
! return (num / span) + low;
}
}
/* Return an object's name, but for exits, return just the first
* component. We expect a valid object.
*/
char *
! shortname(it)
! dbref it;
{
static char n[BUFFER_LEN]; /* STATIC */
char *s;
--- 242,472 ----
}
! void init_genrand(unsigned long);
! void init_by_array(unsigned long *, int);
! #define N 624
!
! /* We use the Mersenne Twister PRNG. It's quite good as PRNGS go,
! * much better than the typical ones provided in system libc's.
! *
! * The following two functions are based on the reference implementation,
! * with changes in the seeding function to use /dev/urandom as a seed
! * if possible.
! *
! * The Mersenne Twister homepage is:
! * http://www.math.keio.ac.jp/~matumoto/emt.html
! *
! * You can get the reference code there.
! */
!
!
! /* Initializing the array with a seed */
! void
! initialize_mt(void)
! {
! #ifdef HAS_DEV_URANDOM
! int fd;
! unsigned long buf[N];
!
! fd = open("/dev/urandom", O_RDONLY);
! if (fd >= 0) {
! int r = read(fd, buf, sizeof buf);
! close(fd);
! if (r <= 0) {
! do_rawlog(LT_ERR,
! "Couldn't read from /dev/urandom! Resorting to normal seeding method.");
! } else {
! do_rawlog(LT_ERR, "Seeded RNG from /dev/urandom");
! init_by_array(buf, r / sizeof(unsigned long));
! return;
! }
! } else
! do_rawlog(LT_ERR,
! "Couldn't open /dev/urandom to seed random number generator. Resorting to normal seeding method.");
!
#endif
+ /* Default seeder. Pick a seed that's fairly random */
+ init_genrand(getpid() | (time(NULL) << 16));
+ }
+
+
+ /* A C-program for MT19937, with initialization improved 2002/1/26.*/
+ /* Coded by Takuji Nishimura and Makoto Matsumoto. */
+
+ /* Before using, initialize the state by using init_genrand(seed) */
+ /* or init_by_array(init_key, key_length). */
+
+ /* This library is free software. */
+ /* This library is distributed in the hope that it will be useful, */
+ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
+ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */
+
+ /* Copyright (C) 1997, 2002 Makoto Matsumoto and Takuji Nishimura. */
+ /* Any feedback is very welcome. */
+ /* http://www.math.keio.ac.jp/matumoto/emt.html */
+ /* email: matumoto@math.keio.ac.jp */
+
+ #include <stdio.h>
+
+ /* Period parameters */
+ #define M 397
+ #define MATRIX_A 0x9908b0dfUL /* constant vector a */
+ #define UPPER_MASK 0x80000000UL /* most significant w-r bits */
+ #define LOWER_MASK 0x7fffffffUL /* least significant r bits */
+
+ static unsigned long mt[N]; /* the array for the state vector */
+ static int mti = N + 1; /* mti==N+1 means mt[N] is not initialized */
+
+ /* initializes mt[N] with a seed */
+ void
+ init_genrand(unsigned long s)
+ {
+ mt[0] = s & 0xffffffffUL;
+ for (mti = 1; mti < N; mti++) {
+ mt[mti] = (1812433253UL * (mt[mti - 1] ^ (mt[mti - 1] >> 30)) + mti);
+ /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
+ /* In the previous versions, MSBs of the seed affect */
+ /* only MSBs of the array mt[]. */
+ /* 2002/01/09 modified by Makoto Matsumoto */
+ mt[mti] &= 0xffffffffUL;
+ /* for >32 bit machines */
+ }
+ }
+
+ /* initialize by an array with array-length */
+ /* init_key is the array for initializing keys */
+ /* key_length is its length */
+ void
+ init_by_array(unsigned long init_key[], int key_length)
+ {
+ int i, j, k;
+ init_genrand(19650218UL);
+ i = 1;
+ j = 0;
+ k = (N > key_length ? N : key_length);
+ for (; k; k--) {
+ mt[i] = (mt[i] ^ ((mt[i - 1] ^ (mt[i - 1] >> 30)) * 1664525UL))
+ + init_key[j] + j; /* non linear */
+ mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
+ i++;
+ j++;
+ if (i >= N) {
+ mt[0] = mt[N - 1];
+ i = 1;
+ }
+ if (j >= key_length)
+ j = 0;
+ }
+ for (k = N - 1; k; k--) {
+ mt[i] = (mt[i] ^ ((mt[i - 1] ^ (mt[i - 1] >> 30)) * 1566083941UL))
+ - i; /* non linear */
+ mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
+ i++;
+ if (i >= N) {
+ mt[0] = mt[N - 1];
+ i = 1;
+ }
+ }
+
+ mt[0] = 0x80000000UL; /* MSB is 1; assuring non-zero initial array */
+ }
+
+ /* generates a random number on [0,0xffffffff]-interval */
+ unsigned long
+ genrand_int32(void)
+ {
+ unsigned long y;
+ static unsigned long mag01[2] = { 0x0UL, MATRIX_A };
+ /* mag01[x] = x * MATRIX_A for x=0,1 */
+
+ if (mti >= N) { /* generate N words at one time */
+ int kk;
+
+ if (mti == N + 1) /* if init_genrand() has not been called, */
+ init_genrand(5489UL); /* a default initial seed is used */
+ for (kk = 0; kk < N - M; kk++) {
+ y = (mt[kk] & UPPER_MASK) | (mt[kk + 1] & LOWER_MASK);
+ mt[kk] = mt[kk + M] ^ (y >> 1) ^ mag01[y & 0x1UL];
+ }
+ for (; kk < N - 1; kk++) {
+ y = (mt[kk] & UPPER_MASK) | (mt[kk + 1] & LOWER_MASK);
+ mt[kk] = mt[kk + (M - N)] ^ (y >> 1) ^ mag01[y & 0x1UL];
+ }
+ y = (mt[N - 1] & UPPER_MASK) | (mt[0] & LOWER_MASK);
+ mt[N - 1] = mt[M - 1] ^ (y >> 1) ^ mag01[y & 0x1UL];
+
+ mti = 0;
+ }
+
+ y = mt[mti++];
+
+ /* Tempering */
+ y ^= (y >> 11);
+ y ^= (y << 7) & 0x9d2c5680UL;
+ y ^= (y << 15) & 0xefc60000UL;
+ y ^= (y >> 18);
+
+ return y;
+ }
+
+ /* generates a random number on [0,0x7fffffff]-interval */
+ long
+ genrand_int31(void)
+ {
+ return (long) (genrand_int32() >> 1);
+ }
+
+ /* Based on MUX's RandomINT32() */
long
! get_random_long(long low, long high)
! {
! unsigned long x, n, n_limit;
! /* Validate parameters */
! if (high < low) {
return 0;
! } else if (high == low) {
! return low;
! }
!
! x = high - low;
! if (LONG_MAX < x) {
! return -1;
}
+ x++;
+
+ /* We can now look for an random number on the interval [0,x-1].
+ //
+
+ // In order to be perfectly conservative about not introducing any
+ // further sources of statistical bias, we're going to call getrand()
+ // until we get a number less than the greatest representable
+ // multiple of x. We'll then return n mod x.
+ //
+ // N.B. This loop happens in randomized constant time, and pretty
+ // damn fast randomized constant time too, since
+ //
+ // P(UINT32_MAX_VALUE - n < UINT32_MAX_VALUE % x) < 0.5, for any x.
+ //
+ // So even for the least desireable x, the average number of times
+ // we will call getrand() is less than 2.
+ */
+
+ n_limit = ULONG_MAX - (ULONG_MAX % x);
+
+ do {
+ n = genrand_int31();
+ } while (n >= n_limit);
+
+ return low + (n % x);
}
/* Return an object's name, but for exits, return just the first
* component. We expect a valid object.
*/
char *
! shortname(dbref it)
{
static char n[BUFFER_LEN]; /* STATIC */
char *s;
*** 1_7_5.98/src/timer.c Tue, 25 Sep 2001 15:42:13 -0500 dunemush (pennmush/b/29_timer.c 1.27 660)
--- 1_7_5.133(w)/src/timer.c Tue, 19 Mar 2002 09:58:48 -0600 dunemush (pennmush/b/29_timer.c 1.28 660)
***************
*** 75,81 ****
{
usr1_triggered = 1;
#ifndef SIGNALS_KEPT
! signal(SIGHUP, (void *) usr1_handler);
#endif
#ifndef VOIDSIG
return 0;
--- 75,81 ----
{
usr1_triggered = 1;
#ifndef SIGNALS_KEPT
! signal(SIGUSR1, (void *) usr1_handler);
#endif
#ifndef VOIDSIG
return 0;
*** 1_7_5.98/src/help.c Mon, 28 Jan 2002 11:02:05 -0600 dunemush (pennmush/f/32_help.c 1.4.1.2.1.1.1.3.2.2.1.1.2.1.1.2.1.4.1.2 660)
--- 1_7_5.133(w)/src/help.c Tue, 19 Mar 2002 09:58:47 -0600 dunemush (pennmush/f/32_help.c 1.4.1.2.1.1.1.3.2.2.1.1.2.1.1.2.1.2.1.2.1.2 660)
***************
*** 23,29 ****
#include "confmagic.h"
#ifdef macintosh
! extern void PMConvertPath(char *path);
#endif
HASHTAB help_files;
--- 23,29 ----
#include "confmagic.h"
#ifdef macintosh
! #include "PMInit.h"
#endif
HASHTAB help_files;
***************
*** 77,87 ****
int admin;
{
help_file *h;
if (help_init == 0)
init_help_files();
! if (!command_name || !filename || !*command_name || !*filename)
return;
/* If there's already an entry for it, complain */
--- 77,91 ----
int admin;
{
help_file *h;
+ char newfilename[256] = "\0";
+
+ /* Must use a buffer for MacOS file path conversion */
+ strncpy(newfilename, filename, 256);
if (help_init == 0)
init_help_files();
! if (!command_name || !filename || !*command_name || !*newfilename)
return;
/* If there's already an entry for it, complain */
***************
*** 91,102 ****
return;
}
#ifdef macintosh
! PMConvertPath((char *) filename);
#endif
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;
--- 95,107 ----
return;
}
#ifdef macintosh
! /* Convert file path from a UNIX style one to a MacOS one */
! PMConvertPath((char *) newfilename, (char *) newfilename, 256);
#endif
h = mush_malloc(sizeof *h, "help_file.entry");
h->command = mush_strdup(strupper(command_name), "help_file.command");
! h->file = mush_strdup(newfilename, "help_file.filename");
h->entries = 0;
h->indx = NULL;
h->admin = admin;
***************
*** 107,114 ****
mush_free(h, "help_file.entry");
return;
}
! command_add(h->command, CMD_T_ANY | CMD_T_NOPARSE, 0, 0, 0, NULL,
! cmd_helpcmd);
hashadd(h->command, h, &help_files);
}
--- 112,119 ----
mush_free(h, "help_file.entry");
return;
}
! (void) command_add(h->command, CMD_T_ANY | CMD_T_NOPARSE, 0, 0, 0, NULL,
! cmd_helpcmd);
hashadd(h->command, h, &help_files);
}
*** 1_7_5.98/src/switchinc.c Fri, 15 Feb 2002 17:07:45 -0600 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.1.2.1.5.1.10 660)
--- 1_7_5.133(w)/src/switchinc.c Tue, 19 Mar 2002 09:58:48 -0600 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.1.2.1.5.1.2.1.7 660)
***************
*** 1,516 ****
{
! "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
! }
! ,
! {
! "DELIMIT", SWITCH_DELIMIT
! }
! ,
! {
! "DESCRIBE", SWITCH_DESCRIBE
! }
! ,
! {
! "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
! }
! ,
! {
! "FOLDERS", SWITCH_FOLDERS
! }
! ,
! {
! "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
! }
! ,
! {
! "WHO", SWITCH_WHO
! }
! ,
! {
! "WIPE", SWITCH_WIPE
! }
! ,
! {
! "WIZ", SWITCH_WIZ
! }
! ,
! {
! "WIZARD", SWITCH_WIZARD
! }
! ,
! {
! "YES", SWITCH_YES
! }
! ,
! {
! "ZONE", SWITCH_ZONE
! }
,
--- 1,391 ----
{
! "ACCESS", SWITCH_ACCESS}
!
! , {
! "ADD", SWITCH_ADD}
!
! , {
! "ALL", SWITCH_ALL}
!
! , {
! "ANY", SWITCH_ANY}
!
! , {
! "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}
!
! , {
! "DELIMIT", SWITCH_DELIMIT}
!
! , {
! "DESCRIBE", SWITCH_DESCRIBE}
!
! , {
! "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}
!
! , {
! "FOLDERS", SWITCH_FOLDERS}
!
! , {
! "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}
!
! , {
! "WHO", SWITCH_WHO}
!
! , {
! "WIPE", SWITCH_WIPE}
!
! , {
! "WIZ", SWITCH_WIZ}
!
! , {
! "WIZARD", SWITCH_WIZARD}
!
! , {
! "YES", SWITCH_YES}
!
! , {
! "ZONE", SWITCH_ZONE}
!
,
*** 1_7_5.98/src/strutil.c Fri, 15 Feb 2002 16:56:28 -0600 dunemush (pennmush/b/33_strutil.c 1.28.1.3.1.3.1.7.2.1.1.5 660)
--- 1_7_5.133(w)/src/strutil.c Tue, 19 Mar 2002 09:58:48 -0600 dunemush (pennmush/b/33_strutil.c 1.28.1.3.1.3.1.7.2.1.1.2.1.2 660)
***************
*** 9,17 ****
#include <stdlib.h>
#include <stdarg.h>
#include <limits.h>
- #ifdef I_MEMORY
- #include <memory.h>
- #endif
#include "copyrite.h"
#include "conf.h"
#include "case.h"
--- 9,14 ----
***************
*** 27,34 ****
#include "log.h"
! char *next_token _((char *str, char sep));
! static int format_long _((long val, char *buff, char **bp, int maxlen));
/* GENERATED TABLE. EDIT AT YOUR OWN RISK. */
--- 24,31 ----
#include "log.h"
! char *next_token(char *str, char sep);
! static int format_long(long val, char *buff, char **bp, int maxlen);
/* GENERATED TABLE. EDIT AT YOUR OWN RISK. */
***************
*** 292,301 ****
};
char *
! mush_strdup(s, check)
! const char *s;
! const char *check __attribute__ ((__unused__));
{
char *x;
--- 289,315 ----
};
+ /* Duplicate the first len characters of s */
char *
! mush_strndup(const char *src, size_t len, const char *check)
! {
! char *copy;
! size_t rlen = strlen(src);
!
! if (rlen < len)
! len = rlen;
!
! copy = mush_malloc(len + 1, check);
! if (copy) {
! memcpy(copy, src, len);
! copy[len] = '\0';
! }
!
! return copy;
! }
!
! char *
! mush_strdup(const char *s, const char *check __attribute__ ((__unused__)))
{
char *x;
***************
*** 317,328 ****
/* Return the string chopped at lim characters */
char *
! chopstr(str, lim)
! const char *str;
! int lim;
{
static char tbuf1[BUFFER_LEN];
! if (strlen(str) <= (Size_t) lim)
return (char *) str;
strncpy(tbuf1, str, lim);
tbuf1[lim] = '\0';
--- 331,340 ----
/* Return the string chopped at lim characters */
char *
! chopstr(const char *str, size_t lim)
{
static char tbuf1[BUFFER_LEN];
! if (strlen(str) <= lim)
return (char *) str;
strncpy(tbuf1, str, lim);
tbuf1[lim] = '\0';
***************
*** 333,341 ****
#ifndef HAS_STRCASECMP
#ifndef WIN32
int
! strcasecmp(s1, s2)
! const char *s1;
! const char *s2;
{
while (*s1 && *s2 && DOWNCASE(*s1) == DOWNCASE(*s2))
s1++, s2++;
--- 345,351 ----
#ifndef HAS_STRCASECMP
#ifndef WIN32
int
! strcasecmp(const char *s1, const char *s2)
{
while (*s1 && *s2 && DOWNCASE(*s1) == DOWNCASE(*s2))
s1++, s2++;
***************
*** 344,353 ****
}
int
! strncasecmp(s1, s2, n)
! const char *s1;
! const char *s2;
! Size_t n;
{
for (; 0 < n; ++s1, ++s2, --n)
if (DOWNCASE(*s1) != DOWNCASE(*s2))
--- 354,360 ----
}
int
! strncasecmp(const char *s1, const char *s2, Size_t n)
{
for (; 0 < n; ++s1, ++s2, --n)
if (DOWNCASE(*s1) != DOWNCASE(*s2))
***************
*** 361,369 ****
#endif /* !HAS_STRCASECMP */
int
! string_prefix(string, prefix)
! const char *string;
! const char *prefix;
{
if (!string || !prefix)
return 0;
--- 368,374 ----
#endif /* !HAS_STRCASECMP */
int
! string_prefix(const char *string, const char *prefix)
{
if (!string || !prefix)
return 0;
***************
*** 374,382 ****
/* accepts only nonempty matches starting at the beginning of a word */
const char *
! string_match(src, sub)
! const char *src;
! const char *sub;
{
if (!src || !sub)
return 0;
--- 379,385 ----
/* accepts only nonempty matches starting at the beginning of a word */
const char *
! string_match(const char *src, const char *sub)
{
if (!src || !sub)
return 0;
***************
*** 396,403 ****
}
char *
! strupper(s)
! const char *s;
{
static char buf1[BUFFER_LEN];
char *p;
--- 399,405 ----
}
char *
! strupper(const char *s)
{
static char buf1[BUFFER_LEN];
char *p;
***************
*** 413,420 ****
}
char *
! strlower(s)
! const char *s;
{
static char buf1[BUFFER_LEN];
char *p;
--- 415,421 ----
}
char *
! strlower(const char *s)
{
static char buf1[BUFFER_LEN];
char *p;
***************
*** 430,437 ****
}
char *
! upcasestr(s)
! char *s;
{
/* modifies a string in-place to be upper-case */
char *p;
--- 431,437 ----
}
char *
! upcasestr(char *s)
{
/* modifies a string in-place to be upper-case */
char *p;
***************
*** 566,588 ****
return len - clen;
}
-
int
! safe_ansi(const char *src, int copylen, char *buff, char **bp)
{
! char tbuf[BUFFER_LEN];
! char ansibuf[BUFFER_LEN], *ap = ansibuf;
! int len;
!
! strncpy(tbuf, src, sizeof tbuf);
! len = ansi_strnlen(tbuf, copylen);
! ansi_save(tbuf + len - 1, -1, ansibuf, &ap);
! len = ansi_align(tbuf, len);
! if (len < BUFFER_LEN)
! tbuf[len] = '\0';
! if (safe_str(tbuf, buff, bp))
! return 1;
! return safe_str(ansibuf, buff, bp);
}
#undef APPEND_ARGS
--- 566,595 ----
return len - clen;
}
int
! safe_fill(char x, size_t n, char *buff, char **bp)
{
! size_t blen;
! int ret = 0;
!
! if (n == 0)
! return 0;
! else if (n == 1)
! return safe_chr(x, buff, bp);
!
! if (n > BUFFER_LEN - 1)
! n = BUFFER_LEN - 1;
!
! blen = BUFFER_LEN - (*bp - buff);
!
! if (blen < n) {
! n = blen;
! ret = 1;
! }
! memset(*bp, x, n);
! *bp += n;
!
! return ret;
}
#undef APPEND_ARGS
***************
*** 591,598 ****
/* skip_space and seek_char are essentially right out of the 2.0 code */
char *
! skip_space(s)
! const char *s;
{
/* returns pointer to the next non-space char in s, or NULL if s == NULL
* or *s == NULL or s has only spaces.
--- 598,604 ----
/* skip_space and seek_char are essentially right out of the 2.0 code */
char *
! skip_space(const char *s)
{
/* returns pointer to the next non-space char in s, or NULL if s == NULL
* or *s == NULL or s has only spaces.
***************
*** 632,638 ****
char *
replace_string(const char *old, const char *newbit, const char *string)
{
- char tbuf1[BUFFER_LEN], *tbuf = tbuf1;
char *result, *r;
Size_t len, newlen;
--- 638,643 ----
***************
*** 717,725 ****
if (sep != ' ')
return str;
! while (*str && (*str == ' '))
! str++;
for (p = str; *p; p++) ;
for (p--; (*p == ' ') && (p > str); p--) ;
p++;
*p = '\0';
--- 722,731 ----
if (sep != ' ')
return str;
! /* Skip leading spaces */
! str += strspn(str, " ");
for (p = str; *p; p++) ;
+ /* And trailing */
for (p--; (*p == ' ') && (p > str); p--) ;
p++;
*p = '\0';
***************
*** 789,797 ****
* match in the first min chars
*/
int
! minmatch(str, target, min)
! const char *str, *target;
! int min;
{
while (*str && *target && (DOWNCASE(*str) == DOWNCASE(*target))) {
str++;
--- 795,801 ----
* match in the first min chars
*/
int
! minmatch(const char *str, const char *target, int min)
{
while (*str && *target && (DOWNCASE(*str) == DOWNCASE(*target))) {
str++;
***************
*** 817,822 ****
--- 821,830 ----
p = (char *) string;
if (!p)
return 0;
+
+ if (!ANSI_JUSTIFY)
+ return strlen(p);
+
while (*p) {
if (*p == ESC_CHAR) {
while ((*p) && (*p != 'm'))
***************
*** 893,900 ****
}
char *
! next_in_list(head)
! char **head;
{
int paren = 0;
static char buf[BUFFER_LEN];
--- 901,907 ----
}
char *
! next_in_list(char **head)
{
int paren = 0;
static char buf[BUFFER_LEN];
***************
*** 926,932 ****
/* Strip all ansi and html markup from a string */
char *
! remove_markup(const char *orig, Size_t *s_len)
{
static char buff[BUFFER_LEN];
char *bp = buff;
--- 933,939 ----
/* Strip all ansi and html markup from a string */
char *
! remove_markup(const char *orig, size_t * s_len)
{
static char buff[BUFFER_LEN];
char *bp = buff;
***************
*** 1114,1178 ****
}
#endif /* HAS_STRXFRM && !WIN32 */
- int
- ansi_save(const char *string, int length, char *buff, char **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;
- }
-
char *
! skip_leading_ansi(s)
! const char *s;
{
char *p = (char *) s;
if (!p)
--- 1121,1128 ----
}
#endif /* HAS_STRXFRM && !WIN32 */
char *
! skip_leading_ansi(const char *s)
{
char *p = (char *) s;
if (!p)
***************
*** 1193,1209 ****
}
ansi_string *
! parse_ansi_string(src)
! const char *src;
{
ansi_string *data;
char *y, *current = NULL;
! int p = 0;
if (!src)
return NULL;
-
data = mush_malloc(sizeof *data, "ansi_string");
if (!data)
return NULL;
--- 1143,1157 ----
}
ansi_string *
! parse_ansi_string(const char *src)
{
ansi_string *data;
char *y, *current = NULL;
! Size_t p = 0;
if (!src)
return NULL;
data = mush_malloc(sizeof *data, "ansi_string");
if (!data)
return NULL;
***************
*** 1213,1228 ****
while (*src) {
y = skip_leading_ansi(src);
if (y != src) {
- char t = *y;
- *y = '\0';
if (current)
! free(current);
! current = strdup(src);
! *y = t;
src = y;
}
if (current)
! data->codes[p] = strdup(current);
else
data->codes[p] = NULL;
data->text[p] = *src;
--- 1161,1173 ----
while (*src) {
y = skip_leading_ansi(src);
if (y != src) {
if (current)
! mush_free(current, "markup_codes");
! current = mush_strndup(src, y - src, "markup_codes");
src = y;
}
if (current)
! data->codes[p] = mush_strdup(current, "markup_codes");
else
data->codes[p] = NULL;
data->text[p] = *src;
***************
*** 1237,1244 ****
}
if (current)
! free(current);
! current = NULL;
return data;
}
--- 1182,1188 ----
}
if (current)
! mush_free(current, "markup_codes");
return data;
}
***************
*** 1247,1253 ****
void
populate_codes(ansi_string * as)
{
! int p;
char *current = NULL;
if (!as)
--- 1191,1197 ----
void
populate_codes(ansi_string * as)
{
! size_t p;
char *current = NULL;
if (!as)
***************
*** 1256,1284 ****
for (p = 0; p < as->len; p++)
if (as->codes[p]) {
if (current)
! free(current);
! current = strdup(as->codes[p]);
} else {
if (!current)
! current = strdup(ANSI_NORMAL);
! as->codes[p] = strdup(current);
}
}
void
depopulate_codes(ansi_string * as)
{
! int p;
if (!as)
return;
for (p = 0; p <= as->len; p++) {
if (as->codes[p]) {
! int m = p;
for (p++; p < as->len; p++) {
if (as->codes[p] && strcmp(as->codes[p], as->codes[m]) == 0) {
! free(as->codes[p]);
as->codes[p] = NULL;
} else {
p--;
--- 1200,1239 ----
for (p = 0; p < as->len; p++)
if (as->codes[p]) {
if (current)
! mush_free(current, "markup_codes");
! current = mush_strdup(as->codes[p], "markup_codes");
} else {
if (!current)
! current = mush_strdup(ANSI_NORMAL, "markup_codes");
! as->codes[p] = mush_strdup(current, "markup_codes");
}
}
void
depopulate_codes(ansi_string * as)
{
! size_t p, m;
! int normal = 1;
if (!as)
return;
for (p = 0; p <= as->len; p++) {
if (as->codes[p]) {
! if (normal) {
! if (strcmp(as->codes[p], ANSI_NORMAL) == 0) {
! mush_free(as->codes[p], "markup_codes");
! as->codes[p] = NULL;
! continue;
! } else {
! normal = 0;
! }
! }
!
! m = p;
for (p++; p < as->len; p++) {
if (as->codes[p] && strcmp(as->codes[p], as->codes[m]) == 0) {
! mush_free(as->codes[p], "markup_codes");
as->codes[p] = NULL;
} else {
p--;
***************
*** 1320,1332 ****
return;
for (p = as->len; p >= 0; p--) {
if (as->codes[p])
! free(as->codes[p]);
}
mush_free(as, "ansi_string");
}
int
! safe_ansi_string(ansi_string * as, int start, int len, char *buff, char **bp)
{
int p;
int in_ansi = 0;
--- 1275,1288 ----
return;
for (p = as->len; p >= 0; p--) {
if (as->codes[p])
! mush_free(as->codes[p], "markup_codes");
}
mush_free(as, "ansi_string");
}
int
! safe_ansi_string(ansi_string * as, size_t start, size_t len, char *buff,
! char **bp)
{
int p;
int in_ansi = 0;
***************
*** 1336,1342 ****
depopulate_codes(as);
! if (start > as->len || start < 0 || as->len < 0)
return safe_str("", buff, bp);
/* Find the starting codes */
--- 1292,1298 ----
depopulate_codes(as);
! if (start > as->len || len == 0 || as->len == 0)
return safe_str("", buff, bp);
/* Find the starting codes */
***************
*** 1344,1352 ****
for (p = start - 1; p >= 0; p--) {
if (as->codes[p]) {
if (!is_end_html_code(as->codes[p])) {
! if (safe_str(as->codes[p], buff, bp))
! return 1;
! in_ansi = 1;
}
break;
}
--- 1300,1310 ----
for (p = start - 1; p >= 0; p--) {
if (as->codes[p]) {
if (!is_end_html_code(as->codes[p])) {
! if (strcmp(as->codes[p], ANSI_NORMAL) != 0) {
! if (safe_str(as->codes[p], buff, bp))
! return 1;
! in_ansi = 1;
! }
}
break;
}
***************
*** 1354,1360 ****
}
/* Copy the text */
! for (p = start; p < (start + len) && p < as->len; p++) {
if (as->codes[p]) {
if (safe_str(as->codes[p], buff, bp))
return 1;
--- 1312,1318 ----
}
/* Copy the text */
! for (p = (int) start; p < (int) (start + len) && p < (int) as->len; p++) {
if (as->codes[p]) {
if (safe_str(as->codes[p], buff, bp))
return 1;
***************
*** 1369,1375 ****
/* Ooutput closing codes if needed. */
if (in_ansi) {
! for (; p <= as->len; p++) {
if (as->codes[p]) {
if ((is_ansi_code(as->codes[p])
&& strcmp(ANSI_NORMAL, as->codes[p]) == 0)
--- 1327,1333 ----
/* Ooutput closing codes if needed. */
if (in_ansi) {
! for (; p <= (int) as->len; p++) {
if (as->codes[p]) {
if ((is_ansi_code(as->codes[p])
&& strcmp(ANSI_NORMAL, as->codes[p]) == 0)
*** 1_7_5.98/src/speech.c Tue, 20 Nov 2001 17:08:09 -0600 dunemush (pennmush/b/35_speech.c 1.21.1.2.1.3.1.5.1.1.1.7.1.3.1.1.1.6 660)
--- 1_7_5.133(w)/src/speech.c Tue, 19 Mar 2002 09:58:48 -0600 dunemush (pennmush/b/35_speech.c 1.21.1.2.1.3.1.5.1.1.1.7.1.3.1.1.1.8 660)
***************
*** 5,18 ****
/* Commands which involve speaking */
#include <ctype.h>
- #ifdef I_STRING
#include <string.h>
- #else
- #include <strings.h>
- #endif
- #ifdef I_STDLIB
#include <stdlib.h>
- #endif
#include "conf.h"
#include "ansi.h"
--- 5,12 ----
***************
*** 30,50 ****
#include "memcheck.h"
#include "confmagic.h"
! static void oemit_notify_except _((dbref loc, dbref exc1, dbref exc2,
! const char *msg));
! const char *reconstruct_message _((char *arg1, char *arg2));
! int okay_pemit _((dbref player, dbref target));
! static dbref speech_loc _((dbref thing));
! void propagate_sound _((dbref thing, const char *msg));
! static void do_audible_stuff _((dbref loc, dbref *excs, int numexcs,
! const char *msg));
! dbref na_zemit _((dbref current, void *data));
! extern int WIN32_CDECL i_comp _((const void *s1, const void *s2));
! static const char *spname _((dbref thing));
static const char *
! spname(thing)
! dbref thing;
{
/* if FULL_INVIS is defined, dark wizards and dark objects will be
* Someone and Something, respectively.
--- 24,43 ----
#include "memcheck.h"
#include "confmagic.h"
! static void oemit_notify_except(dbref loc, dbref exc1, dbref exc2,
! const char *msg);
! const char *reconstruct_message(char *arg1, char *arg2);
! int okay_pemit(dbref player, dbref target);
! static dbref speech_loc(dbref thing);
! void propagate_sound(dbref thing, const char *msg);
! static void do_audible_stuff(dbref loc, dbref *excs, int numexcs,
! const char *msg);
! dbref na_zemit(dbref current, void *data);
! extern int WIN32_CDECL i_comp(const void *s1, const void *s2);
! static const char *spname(dbref thing);
static const char *
! spname(dbref thing)
{
/* if FULL_INVIS is defined, dark wizards and dark objects will be
* Someone and Something, respectively.
***************
*** 61,69 ****
}
int
! okay_pemit(player, target)
! dbref player;
! dbref target;
{
if (Pemit_All(player))
return 1;
--- 54,60 ----
}
int
! okay_pemit(dbref player, dbref target)
{
if (Pemit_All(player))
return 1;
***************
*** 76,83 ****
}
static dbref
! speech_loc(thing)
! dbref thing;
{
/* This is the place where speech, poses, and @emits by thing should be
* heard. For things and players, it's the loc; For rooms, it's the room
--- 67,73 ----
}
static dbref
! speech_loc(dbref thing)
{
/* This is the place where speech, poses, and @emits by thing should be
* heard. For things and players, it's the loc; For rooms, it's the room
***************
*** 95,104 ****
}
void
! do_teach(player, cause, tbuf1)
! dbref player;
! dbref cause;
! const char *tbuf1;
{
dbref loc;
static int recurse = 0;
--- 85,91 ----
}
void
! do_teach(dbref player, dbref cause, const char *tbuf1)
{
dbref loc;
static int recurse = 0;
***************
*** 135,143 ****
}
void
! do_say(player, tbuf1)
! dbref player;
! const char *tbuf1;
{
dbref loc;
--- 122,128 ----
}
void
! do_say(dbref player, const char *tbuf1)
{
dbref loc;
***************
*** 154,169 ****
tbuf1++;
/* notify everybody */
! notify(player, tprintf(T("You say, \"%s\""), tbuf1));
notify_except(Contents(loc), player,
tprintf(T("%s says, \"%s\""), spname(player), tbuf1));
}
void
! do_oemit(player, arg1, arg2)
! dbref player;
! const char *arg1;
! const char *arg2;
{
dbref who;
dbref loc;
--- 139,151 ----
tbuf1++;
/* notify everybody */
! notify_format(player, T("You say, \"%s\""), tbuf1);
notify_except(Contents(loc), player,
tprintf(T("%s says, \"%s\""), spname(player), tbuf1));
}
void
! do_oemit(dbref player, const char *arg1, const char *arg2)
{
dbref who;
dbref loc;
***************
*** 205,214 ****
}
void
! do_oemit_list(player, list, message)
! dbref player;
! char *list;
! const char *message;
{
char *temp, *p, *s;
dbref who;
--- 187,193 ----
}
void
! do_oemit_list(dbref player, char *list, const char *message)
{
char *temp, *p, *s;
dbref who;
***************
*** 307,317 ****
}
void
! do_whisper(player, arg1, arg2, noisy)
! dbref player;
! const char *arg1;
! const char *arg2;
! int noisy; /* 0 for silent, 1 for noisy */
{
dbref who;
int key;
--- 286,292 ----
}
void
! do_whisper(dbref player, const char *arg1, const char *arg2, int noisy)
{
dbref who;
int key;
***************
*** 448,456 ****
(get_random_long(0, 100) < WHISPER_LOUDNESS) &&
(Location(player) == Location(who))) {
bp2 = overbuf;
! safe_str(tprintf
! (T("%s whispers to %s."), Name(player), Name(good[who])),
! overbuf, &bp2);
*bp2 = '\0';
overheard = 1;
}
--- 423,430 ----
(get_random_long(0, 100) < WHISPER_LOUDNESS) &&
(Location(player) == Location(who))) {
bp2 = overbuf;
! safe_format(overbuf, &bp2, T("%s whispers to %s."),
! Name(player), Name(good[who]));
*bp2 = '\0';
overheard = 1;
}
***************
*** 510,519 ****
}
void
! do_pemit_list(player, list, message)
! dbref player;
! char *list;
! const char *message;
{
/* Send a message to a list of dbrefs. To avoid repeated generation
* of the NOSPOOF string, we set it up the first time we encounter
--- 484,490 ----
}
void
! do_pemit_list(dbref player, char *list, const char *message)
{
/* Send a message to a list of dbrefs. To avoid repeated generation
* of the NOSPOOF string, we set it up the first time we encounter
***************
*** 555,565 ****
}
void
! do_pemit(player, arg1, arg2, silent)
! dbref player;
! const char *arg1;
! const char *arg2;
! int silent;
{
dbref who;
--- 526,532 ----
}
void
! do_pemit(dbref player, const char *arg1, const char *arg2, int silent)
{
dbref who;
***************
*** 578,608 ****
break;
}
if (!okay_pemit(player, who)) {
! notify(player,
! tprintf(T("I'm sorry, but %s wishes to be left alone now."),
! Name(who)));
return;
}
if (!silent)
! notify(player, tprintf(T("You pemit \"%s\" to %s."), arg2, Name(who)));
if (Nospoof(who)) {
if (Paranoid(who))
! notify(who, tprintf("[%s(#%d)->%s] %s", Name(player), player,
! Name(who), arg2));
else
! notify(who, tprintf("[%s->%s] %s", Name(player), Name(who), arg2));
} else {
! notify(who, tprintf("%s", arg2));
}
break;
}
}
void
! do_pose(player, tbuf1, space)
! dbref player;
! const char *tbuf1;
! int space;
{
dbref loc;
--- 545,572 ----
break;
}
if (!okay_pemit(player, who)) {
! notify_format(player,
! T("I'm sorry, but %s wishes to be left alone now."),
! Name(who));
return;
}
if (!silent)
! notify_format(player, T("You pemit \"%s\" to %s."), arg2, Name(who));
if (Nospoof(who)) {
if (Paranoid(who))
! notify_format(who, "[%s(#%d)->%s] %s", Name(player), player,
! Name(who), arg2);
else
! notify_format(who, "[%s->%s] %s", Name(player), Name(who), arg2);
} else {
! notify(who, arg2);
}
break;
}
}
void
! do_pose(dbref player, const char *tbuf1, int space)
{
dbref loc;
***************
*** 625,635 ****
}
void
! do_wall(player, message, privs, key)
! dbref player;
! const char *message;
! int privs;
! int key;
{
/* privs is 0 for wizard wizwall, 1 for royalty-wizard wizwall,
* 2 is for general wall
--- 589,595 ----
}
void
! do_wall(dbref player, const char *message, int privs, int key)
{
/* privs is 0 for wizard wizwall, 1 for royalty-wizard wizwall,
* 2 is for general wall
***************
*** 732,744 ****
}
void
! do_page(player, arg1, arg2, cause, noeval, multipage)
! dbref player;
! const char *arg1;
! const char *arg2;
! dbref cause;
! int noeval;
! int multipage;
{
dbref target;
char *message;
--- 692,699 ----
}
void
! do_page(dbref player, const char *arg1, const char *arg2, dbref cause,
! int noeval, int multipage)
{
dbref target;
char *message;
***************
*** 815,821 ****
return;
}
if (!message || !*message) {
! notify(player, tprintf(T("You last paged %s."), tbuf2));
mush_free((Malloc_t) tbuf, "string");
mush_free((Malloc_t) tbuf2, "string");
mush_free((Malloc_t) goodlist, "string");
--- 770,776 ----
return;
}
if (!message || !*message) {
! notify_format(player, T("You last paged %s."), tbuf2);
mush_free((Malloc_t) tbuf, "string");
mush_free((Malloc_t) tbuf2, "string");
mush_free((Malloc_t) goodlist, "string");
***************
*** 910,916 ****
/* Can the player afford to pay for this thing? */
if (!payfor(player, PAGE_COST * gcount)) {
! notify(player, tprintf(T("You don't have enough %s."), MONIES));
mush_free((Malloc_t) tbuf, "string");
mush_free((Malloc_t) tbuf2, "string");
mush_free((Malloc_t) goodlist, "string");
--- 865,871 ----
/* Can the player afford to pay for this thing? */
if (!payfor(player, PAGE_COST * gcount)) {
! notify_format(player, T("You don't have enough %s."), MONIES);
mush_free((Malloc_t) tbuf, "string");
mush_free((Malloc_t) tbuf2, "string");
mush_free((Malloc_t) goodlist, "string");
***************
*** 1035,1041 ****
/* Tell each page recipient with 'tbuf' */
for (i = 0; i < gcount; i++) {
if (!IsPlayer(player) && Nospoof(good[i]))
! notify(good[i], tprintf("[#%d] %s", player, tbuf));
else
notify(good[i], tbuf);
--- 990,996 ----
/* Tell each page recipient with 'tbuf' */
for (i = 0; i < gcount; i++) {
if (!IsPlayer(player) && Nospoof(good[i]))
! notify_format(good[i], "[#%d] %s", player, tbuf);
else
notify(good[i], tbuf);
***************
*** 1070,1081 ****
int
! filter_found(thing, msg, flag)
! dbref thing;
! const char *msg;
! int flag;
!
!
/* 0 for @filter, 1 for @infilter */
{
/* check to see if the message matches the filter pattern on thing */
--- 1025,1031 ----
int
! filter_found(dbref thing, const char *msg, int flag)
/* 0 for @filter, 1 for @infilter */
{
/* check to see if the message matches the filter pattern on thing */
***************
*** 1123,1131 ****
/* Return thing/PREFIX + msg */
const char *
! make_prefixstr(thing, msg)
! dbref thing;
! const char *msg;
{
char *bp;
char const *asave, *ap;
--- 1073,1079 ----
/* Return thing/PREFIX + msg */
const char *
! make_prefixstr(dbref thing, const char *msg)
{
char *bp;
char const *asave, *ap;
***************
*** 1169,1177 ****
}
void
! propagate_sound(thing, msg)
! dbref thing;
! const char *msg;
{
/* pass a message on, for AUDIBLE, prepending a prefix, unless the
* message matches a filter pattern.
--- 1117,1123 ----
}
void
! propagate_sound(dbref thing, const char *msg)
{
/* pass a message on, for AUDIBLE, prepending a prefix, unless the
* message matches a filter pattern.
***************
*** 1205,1215 ****
}
static void
! do_audible_stuff(loc, excs, numexcs, msg)
! dbref loc;
! dbref *excs;
! int numexcs;
! const char *msg;
{
dbref e;
int exclude = 0;
--- 1151,1157 ----
}
static void
! do_audible_stuff(dbref loc, dbref *excs, int numexcs, const char *msg)
{
dbref e;
int exclude = 0;
***************
*** 1233,1242 ****
}
void
! notify_except(first, exception, msg)
! dbref first;
! dbref exception;
! const char *msg;
{
dbref loc;
dbref pass[2];
--- 1175,1181 ----
}
void
! notify_except(dbref first, dbref exception, const char *msg)
{
dbref loc;
dbref pass[2];
***************
*** 1258,1268 ****
}
void
! notify_except2(first, exc1, exc2, msg)
! dbref first;
! dbref exc1;
! dbref exc2;
! const char *msg;
{
dbref loc;
dbref pass[3];
--- 1197,1203 ----
}
void
! notify_except2(dbref first, dbref exc1, dbref exc2, const char *msg)
{
dbref loc;
dbref pass[3];
***************
*** 1288,1298 ****
}
static void
! oemit_notify_except(loc, exc1, exc2, msg)
! dbref loc;
! dbref exc1;
! dbref exc2;
! const char *msg;
{
dbref pass[3];
--- 1223,1229 ----
}
static void
! oemit_notify_except(dbref loc, dbref exc1, dbref exc2, const char *msg)
{
dbref pass[3];
***************
*** 1314,1335 ****
}
void
! do_think(player, message)
! dbref player;
! const char *message;
{
/* privately tell yourself a message */
- /* notify the player only, with no special fanfare */
- /* Why was this tprintf'd? */
notify(player, message);
}
void
! do_emit(player, tbuf1)
! dbref player;
! const char *tbuf1;
{
dbref loc;
--- 1245,1260 ----
}
void
! do_think(dbref player, const char *message)
{
/* privately tell yourself a message */
notify(player, message);
}
void
! do_emit(dbref player, const char *tbuf1)
{
dbref loc;
***************
*** 1349,1393 ****
}
void
! do_remit(player, arg1, arg2, noisy)
! dbref player;
! const char *arg1;
! const char *arg2;
! int noisy;
{
dbref room;
! const char *rmno;
!
! room = match_result(player, arg1, NOTYPE, MAT_EVERYTHING);
if (!GoodObject(room)) {
notify(player, T("I can't find that."));
} else {
if (IsExit(room)) {
notify(player, T("There can't be anything in that!"));
} else if (!okay_pemit(player, room)) {
! notify(player,
! tprintf(T("I'm sorry, but %s wishes to be left alone now."),
! Name(room)));
} else if (!Hasprivs(player) && !eval_lock(player, room, Speech_Lock)) {
notify(player, T("You may not speak there!"));
} else {
!
rmno = unparse_object(player, room);
if (Location(player) == room) {
! notify(player, arg2);
} else if (noisy) {
! notify(player, tprintf(T("You remit, \"%s\" in %s"), arg2, rmno));
}
! oemit_notify_except(room, player, room, arg2);
}
}
}
void
! do_lemit(player, tbuf1, silent)
! dbref player;
! const char *tbuf1;
! int silent;
{
/* give a message to the "absolute" location of an object */
--- 1274,1323 ----
}
void
! do_one_remit(dbref player, const char *target, const char *msg, int noisy)
{
dbref room;
! room = match_result(player, target, NOTYPE, MAT_EVERYTHING);
if (!GoodObject(room)) {
notify(player, T("I can't find that."));
} else {
if (IsExit(room)) {
notify(player, T("There can't be anything in that!"));
} else if (!okay_pemit(player, room)) {
! notify_format(player,
! T("I'm sorry, but %s wishes to be left alone now."),
! Name(room));
} else if (!Hasprivs(player) && !eval_lock(player, room, Speech_Lock)) {
notify(player, T("You may not speak there!"));
} else {
! const char *rmno;
rmno = unparse_object(player, room);
if (Location(player) == room) {
! notify(player, msg);
} else if (noisy) {
! notify_format(player, T("You remit, \"%s\" in %s"), msg, rmno);
}
! oemit_notify_except(room, player, room, msg);
}
}
}
void
! do_remit(dbref player, char *arg1, const char *arg2, int flags)
! {
! if (flags & 0x2) {
! /* @remit/list */
! char *current;
! arg1 = trim_space_sep(arg1, ' ');
! while ((current = split_token(&arg1, ' ')) != NULL)
! do_one_remit(player, current, arg2, flags & 0x1);
! } else {
! do_one_remit(player, arg1, arg2, flags & 0x1);
! }
! }
!
! void
! do_lemit(dbref player, const char *tbuf1, int silent)
{
/* give a message to the "absolute" location of an object */
***************
*** 1416,1430 ****
notify(player, T("You may not speak there!"));
} else {
if (!silent)
! notify(player, tprintf(T("You lemit: \"%s\""), tbuf1));
oemit_notify_except(room, player, room, tbuf1);
}
}
dbref
! na_zemit(current, data)
! dbref current __attribute__ ((__unused__));
! void *data;
{
dbref this;
dbref room;
--- 1346,1358 ----
notify(player, T("You may not speak there!"));
} else {
if (!silent)
! notify_format(player, T("You lemit: \"%s\""), tbuf1);
oemit_notify_except(room, player, room, tbuf1);
}
}
dbref
! na_zemit(dbref current __attribute__ ((__unused__)), void *data)
{
dbref this;
dbref room;
***************
*** 1454,1463 ****
}
void
! do_zemit(player, arg1, arg2)
! dbref player;
! const char *arg1;
! const char *arg2;
{
const char *where;
dbref zone;
--- 1382,1388 ----
}
void
! do_zemit(dbref player, const char *arg1, const char *arg2)
{
const char *where;
dbref zone;
***************
*** 1478,1484 ****
return;
}
where = unparse_object(player, zone);
! notify(player, tprintf(T("You zemit, \"%s\" in zone %s"), arg2, where));
pass[0] = NOTHING;
pass[1] = 0;
--- 1403,1409 ----
return;
}
where = unparse_object(player, zone);
! notify_format(player, T("You zemit, \"%s\" in zone %s"), arg2, where);
pass[0] = NOTHING;
pass[1] = 0;
*** 1_7_5.98/src/rob.c Tue, 04 Sep 2001 09:08:48 -0500 dunemush (pennmush/b/42_rob.c 1.18.1.2.1.4 660)
--- 1_7_5.133(w)/src/rob.c Tue, 19 Mar 2002 09:58:48 -0600 dunemush (pennmush/b/42_rob.c 1.18.1.2.1.3.1.4 660)
***************
*** 188,197 ****
myenv[0] = (char *) mush_malloc(BUFFER_LEN, "dbref");
myenv[1] = (char *) mush_malloc(BUFFER_LEN, "dbref");
sprintf(myenv[0], "#%d", thing);
! sprintf(myenv[1], "#%d", player);
for (i = 2; i < 10; i++)
myenv[i] = NULL;
! real_did_it(player, player, "GIVE", "Given.", "OGIVE", NULL,
"AGIVE", NOTHING, myenv);
/* Notify the object that it's been given */
--- 188,201 ----
myenv[0] = (char *) mush_malloc(BUFFER_LEN, "dbref");
myenv[1] = (char *) mush_malloc(BUFFER_LEN, "dbref");
sprintf(myenv[0], "#%d", thing);
! sprintf(myenv[1], "#%d", who);
for (i = 2; i < 10; i++)
myenv[i] = NULL;
! bp = tbuf1;
! safe_format(tbuf1, &bp, T("You gave %s to %s."), Name(thing),
! Name(who));
! *bp = '\0';
! real_did_it(player, player, "GIVE", tbuf1, "OGIVE", NULL,
"AGIVE", NOTHING, myenv);
/* Notify the object that it's been given */
*** 1_7_5.98/src/parse.c Mon, 04 Feb 2002 09:23:20 -0600 dunemush (pennmush/b/48_parse.c 1.23.1.10.1.2.1.1.1.2 660)
--- 1_7_5.133(w)/src/parse.c Tue, 19 Mar 2002 09:58:47 -0600 dunemush (pennmush/b/48_parse.c 1.23.1.10.1.2.1.1.1.1.1.2.1.2 660)
***************
*** 62,67 ****
--- 62,68 ----
char e_num[] = "#-1 ARGUMENT MUST BE NUMBER";
char e_nums[] = "#-1 ARGUMENTS MUST BE NUMBERS";
char e_invoke[] = "#-1 FUNCTION INVOCATION LIMIT EXCEEDED";
+ char e_call[] = "#-1 CALL LIMIT EXCEEDED";
char e_perm[] = "#-1 PERMISSION DENIED";
char e_atrperm[] = "#-1 NO PERMISSION TO GET ATTRIBUTE";
char e_match[] = "#-1 NO MATCH";
***************
*** 85,90 ****
--- 86,92 ----
temp = T("#-1 ARGUMENT MUST BE NUMBER");
temp = T("#-1 ARGUMENTS MUST BE NUMBERS");
temp = T("#-1 FUNCTION INVOCATION LIMIT EXCEEDED");
+ temp = T("#-1 CALL LIMIT EXCEEDED");
temp = T("#-1 PERMISSION DENIED");
temp = T("#-1 NO PERMISSION TO GET ATTRIBUTE");
temp = T("#-1 NO MATCH");
***************
*** 328,333 ****
--- 330,337 ----
int temp_eflags;
int old_iter_limit;
int qindex;
+ int e_len;
+ const char *e_msg;
if (!buff || !bp || !str || !*str)
return;
***************
*** 342,352 ****
if (!pe_info) {
old_iter_limit = inum_limit;
inum_limit = inum;
} else {
old_iter_limit = -1;
}
-
if (eflags != PE_NOTHING) {
if (((*bp) - buff) > (BUFFER_LEN - SBUF_LEN)) {
realbuff = buff;
--- 346,363 ----
if (!pe_info) {
old_iter_limit = inum_limit;
inum_limit = inum;
+ made_info = 1;
+ pe_info = (PE_Info *) mush_malloc(sizeof(PE_Info),
+ "process_expression.pe_info");
+ pe_info->fun_invocations = 0;
+ pe_info->fun_depth = 0;
+ pe_info->nest_depth = 0;
+ pe_info->call_depth = 0;
+ pe_info->debug_strings = NULL;
} else {
old_iter_limit = -1;
}
if (eflags != PE_NOTHING) {
if (((*bp) - buff) > (BUFFER_LEN - SBUF_LEN)) {
realbuff = buff;
***************
*** 356,361 ****
--- 367,384 ----
*bp = buff;
startpos = buff;
}
+ }
+
+ if (CALL_LIMIT && (pe_info->call_depth++ > CALL_LIMIT)) {
+ e_msg = T(e_call);
+ e_len = strlen(e_msg);
+ if ((buff + e_len > *bp) || strcmp(e_msg, *bp - e_len))
+ safe_str(e_msg, buff, bp);
+ goto exit_sequence;
+ }
+
+
+ if (eflags != PE_NOTHING) {
debugging = Debug(executor) && Connected(Owner(executor));
if (debugging) {
int j;
***************
*** 363,377 ****
char const *mark;
Debug_Info *node;
- if (!pe_info) {
- made_info = 1;
- pe_info = (PE_Info *) mush_malloc(sizeof(PE_Info),
- "process_expression.pe_info");
- pe_info->fun_invocations = 0;
- pe_info->fun_depth = 0;
- pe_info->nest_depth = 0;
- pe_info->debug_strings = NULL;
- }
debugstr = (char *) mush_malloc(BUFFER_LEN,
"process_expression.debug_source");
debugp = debugstr;
--- 386,391 ----
***************
*** 656,669 ****
}
break;
case '{': /* "{}" parse group; recurse with no function check */
! if (!pe_info && eflags != PE_NOTHING) {
! made_info = 1;
! pe_info = (PE_Info *) mush_malloc(sizeof(PE_Info),
! "process_expression.pe_info");
! pe_info->fun_invocations = 0;
! pe_info->fun_depth = 0;
! pe_info->nest_depth = 0;
! pe_info->debug_strings = NULL;
}
if (eflags & PE_LITERAL) {
safe_chr('{', buff, bp);
--- 670,678 ----
}
break;
case '{': /* "{}" parse group; recurse with no function check */
! if (CALL_LIMIT && (pe_info->call_depth > CALL_LIMIT)) {
! (*str)++;
! break;
}
if (eflags & PE_LITERAL) {
safe_chr('{', buff, bp);
***************
*** 688,701 ****
eflags &= ~PE_COMMAND_BRACES;
break;
case '[': /* "[]" parse group; recurse with mandatory function check */
! if (!pe_info && eflags != PE_NOTHING) {
! made_info = 1;
! pe_info = (PE_Info *) mush_malloc(sizeof(PE_Info),
! "process_expression.pe_info");
! pe_info->fun_invocations = 0;
! pe_info->fun_depth = 0;
! pe_info->nest_depth = 0;
! pe_info->debug_strings = NULL;
}
if (eflags & PE_LITERAL) {
safe_chr('[', buff, bp);
--- 697,705 ----
eflags &= ~PE_COMMAND_BRACES;
break;
case '[': /* "[]" parse group; recurse with mandatory function check */
! if (CALL_LIMIT && (pe_info->call_depth > CALL_LIMIT)) {
! (*str)++;
! break;
}
if (eflags & PE_LITERAL) {
safe_chr('[', buff, bp);
***************
*** 718,731 ****
}
break;
case '(': /* Function call */
! if (!pe_info && eflags != PE_NOTHING) {
! made_info = 1;
! pe_info = (PE_Info *) mush_malloc(sizeof(PE_Info),
! "process_expression.pe_info");
! pe_info->fun_invocations = 0;
! pe_info->fun_depth = 0;
! pe_info->nest_depth = 0;
! pe_info->debug_strings = NULL;
}
(*str)++;
if (!(eflags & PE_EVALUATE) || !(eflags & PE_FUNCTION_CHECK)) {
--- 722,730 ----
}
break;
case '(': /* Function call */
! if (CALL_LIMIT && (pe_info->call_depth > CALL_LIMIT)) {
! (*str)++;
! break;
}
(*str)++;
if (!(eflags & PE_EVALUATE) || !(eflags & PE_FUNCTION_CHECK)) {
***************
*** 798,806 ****
/* Check for the invocation limit */
if ((pe_info->fun_invocations >= FUNCTION_LIMIT) ||
(global_fun_invocations >= FUNCTION_LIMIT * 5)) {
! int e_len = strlen(e_invoke);
! if ((buff + e_len > *bp) || strcmp(e_invoke, *bp - e_len))
! safe_str(T(e_invoke), buff, bp);
process_expression(name, &tp, str,
executor, caller, enactor,
PE_NOTHING, PT_PAREN, pe_info);
--- 797,806 ----
/* Check for the invocation limit */
if ((pe_info->fun_invocations >= FUNCTION_LIMIT) ||
(global_fun_invocations >= FUNCTION_LIMIT * 5)) {
! e_msg = T(e_invoke);
! e_len = strlen(e_msg);
! if ((buff + e_len > *bp) || strcmp(e_msg, *bp - e_len))
! safe_str(e_msg, buff, bp);
process_expression(name, &tp, str,
executor, caller, enactor,
PE_NOTHING, PT_PAREN, pe_info);
***************
*** 1038,1045 ****
}
mush_free((Malloc_t) debugstr, "process_expression.debug_source");
}
- if (made_info)
- mush_free((Malloc_t) pe_info, "process_expression.pe_info");
if (realbuff) {
**bp = '\0';
*bp = realbp;
--- 1038,1043 ----
***************
*** 1047,1052 ****
--- 1045,1052 ----
mush_free((Malloc_t) buff, "process_expression.buffer_extension");
}
}
+ if (made_info)
+ mush_free((Malloc_t) pe_info, "process_expression.pe_info");
if (old_iter_limit != -1) {
inum_limit = old_iter_limit;
}
*** 1_7_5.98/src/move.c Tue, 25 Sep 2001 16:33:36 -0500 dunemush (pennmush/b/51_move.c 1.1.1.18.1.5.1.13.1.3.1.9.1.1.1.2 660)
--- 1_7_5.133(w)/src/move.c Tue, 19 Mar 2002 09:58:47 -0600 dunemush (pennmush/b/51_move.c 1.1.1.18.1.5.1.13.1.3.1.9.1.1.1.1.1.3 660)
***************
*** 495,501 ****
{
dbref loc = Location(player);
dbref thing;
! char tbuf1[BUFFER_LEN];
long match_flags =
MAT_NEIGHBOR | MAT_ABSOLUTE | MAT_CHECK_KEYS | MAT_NEAR | MAT_ENGLISH;
char *myenv[10];
--- 495,501 ----
{
dbref loc = Location(player);
dbref thing;
! char tbuf1[BUFFER_LEN], tbuf2[BUFFER_LEN];
long match_flags =
MAT_NEIGHBOR | MAT_ABSOLUTE | MAT_CHECK_KEYS | MAT_NEAR | MAT_ENGLISH;
char *myenv[10];
***************
*** 526,538 ****
(controls(player, thing) ||
(EnterOk(Location(thing)) &&
eval_lock(player, Location(thing), Enter_Lock)))) {
notify(Location(thing),
tprintf(T("%s was taken from you."), Name(thing)));
! moveto(thing, player);
! notify(thing, T("Taken."));
! sprintf(tbuf1, T("takes %s."), Name(thing));
! did_it(player, thing, "SUCCESS", T("Taken."), "OSUCCESS", tbuf1,
! "ASUCCESS", NOTHING);
myenv[0] = (char *) mush_malloc(BUFFER_LEN, "dbref");
sprintf(myenv[0], "#%d", thing);
for (i = 1; i < 10; i++)
--- 526,541 ----
(controls(player, thing) ||
(EnterOk(Location(thing)) &&
eval_lock(player, Location(thing), Enter_Lock)))) {
+ moveto(thing, player);
notify(Location(thing),
tprintf(T("%s was taken from you."), Name(thing)));
! notify_format(thing, T("%s took you."), Name(player));
! sprintf(tbuf1, T("You take %s from %s."), Name(thing),
! Name(Location(thing)));
! sprintf(tbuf2, T("takes %s from %s."), Name(thing),
! Name(Location(thing)));
! did_it(player, thing, "SUCCESS", tbuf1, "OSUCCESS", tbuf2, "ASUCCESS",
! NOTHING);
myenv[0] = (char *) mush_malloc(BUFFER_LEN, "dbref");
sprintf(myenv[0], "#%d", thing);
for (i = 1; i < 10; i++)
***************
*** 571,579 ****
}
if (could_doit(player, thing)) {
moveto(thing, player);
! notify(thing, T("Taken."));
! sprintf(tbuf1, T("takes %s."), Name(thing));
! did_it(player, thing, "SUCCESS", T("Taken."), "OSUCCESS", tbuf1,
"ASUCCESS", NOTHING);
myenv[0] = (char *) mush_malloc(BUFFER_LEN, "dbref");
sprintf(myenv[0], "#%d", thing);
--- 574,583 ----
}
if (could_doit(player, thing)) {
moveto(thing, player);
! notify_format(thing, T("%s took you."), Name(player));
! sprintf(tbuf1, T("You take %s."), Name(thing));
! sprintf(tbuf2, T("takes %s."), Name(thing));
! did_it(player, thing, "SUCCESS", tbuf1, "OSUCCESS", tbuf2,
"ASUCCESS", NOTHING);
myenv[0] = (char *) mush_malloc(BUFFER_LEN, "dbref");
sprintf(myenv[0], "#%d", thing);
***************
*** 605,611 ****
{
dbref loc;
dbref thing;
! char tbuf1[BUFFER_LEN];
if ((loc = Location(player)) == NOTHING)
return;
--- 609,615 ----
{
dbref loc;
dbref thing;
! char tbuf1[BUFFER_LEN], tbuf2[BUFFER_LEN];
if ((loc = Location(player)) == NOTHING)
return;
***************
*** 639,655 ****
safe_tel(thing, HOME, 0);
} else if ((Location(loc) != NOTHING) && IsRoom(loc) && !Sticky(loc)) {
/* location has immediate dropto */
! notify(thing, T("Dropped."));
moveto(thing, Location(loc));
} else {
! notify(thing, T("Dropped."));
moveto(thing, loc);
}
break;
}
! sprintf(tbuf1, T("drops %s."), Name(thing));
! did_it(player, thing, "DROP", T("Dropped."), "ODROP", tbuf1, "ADROP",
! NOTHING);
}
--- 643,659 ----
safe_tel(thing, HOME, 0);
} else if ((Location(loc) != NOTHING) && IsRoom(loc) && !Sticky(loc)) {
/* location has immediate dropto */
! notify_format(thing, T("%s drops you."), Name(player));
moveto(thing, Location(loc));
} else {
! notify_format(thing, T("%s drops you."), Name(player));
moveto(thing, loc);
}
break;
}
! sprintf(tbuf1, T("You drop %s."), Name(thing));
! sprintf(tbuf2, T("drops %s."), Name(thing));
! did_it(player, thing, "DROP", tbuf1, "ODROP", tbuf2, "ADROP", NOTHING);
}
*** 1_7_5.98/src/log.c Fri, 04 Jan 2002 15:23:43 -0600 dunemush (pennmush/c/5_log.c 1.10.1.2.1.2 660)
--- 1_7_5.133(w)/src/log.c Tue, 19 Mar 2002 09:58:47 -0600 dunemush (pennmush/c/5_log.c 1.10.1.2.2.4 660)
***************
*** 29,35 ****
void end_log(FILE * fp);
#ifdef macintosh
! extern void PMConvertPath(char *path);
#endif
/* log file pointers */
--- 29,35 ----
void end_log(FILE * fp);
#ifdef macintosh
! #include "PMInit.h"
#endif
/* log file pointers */
***************
*** 69,82 ****
FILE **fp;
const char *filename;
{
#ifdef macintosh
! PMConvertPath((char *) filename);
! *fp = fopen(filename, "ab");
#else
! *fp = fopen(filename, "a");
#endif
if (*fp == NULL) {
! fprintf(stderr, T("WARNING: cannot open log %s\n"), filename);
*fp = stderr;
}
fprintf(*fp, "START OF LOG.\n");
--- 69,88 ----
FILE **fp;
const char *filename;
{
+ char newfilename[256] = "\0";
+
+ /* Must use a buffer for MacOS file path conversion */
+ strncpy(newfilename, filename, 256);
+
#ifdef macintosh
! /* Convert file path from a UNIX style one to a MacOS one */
! PMConvertPath((char *) newfilename, (char *) newfilename, 256);
! *fp = fopen(newfilename, "ab");
#else
! *fp = fopen(newfilename, "a");
#endif
if (*fp == NULL) {
! fprintf(stderr, T("WARNING: cannot open log %s\n"), newfilename);
*fp = stderr;
}
fprintf(*fp, "START OF LOG.\n");
*** 1_7_5.98/src/game.c Fri, 15 Feb 2002 16:15:40 -0600 dunemush (pennmush/c/10_game.c 1.50.1.8.1.1.1.1.2.1.1.1.2.1.1.4.1.1.1.1.1.1.1.1.1.1.2.1.1.3 660)
--- 1_7_5.133(w)/src/game.c Tue, 19 Mar 2002 09:58:47 -0600 dunemush (pennmush/c/10_game.c 1.50.1.8.1.1.1.1.2.1.1.1.2.1.1.4.1.1.1.1.1.1.1.1.1.1.2.1.1.2.1.1.1.2 660)
***************
*** 36,42 ****
#endif
#ifdef macintosh
! extern void PMSMushSetup(void);
#endif
#include "conf.h"
--- 36,42 ----
#endif
#ifdef macintosh
! extern void PMSSetupDatabases(void);
#endif
#include "conf.h"
***************
*** 99,104 ****
--- 99,106 ----
extern dbref cplr;
extern char ccom[];
+ extern void initialize_mt(void);
+
int paranoid_dump = 0; /* if paranoid, scan before dumping */
int paranoid_checkpt = 0; /* write out an okay message every x objs */
extern long indb_flags;
***************
*** 698,704 ****
Win32MUSH_setup(); /* create index files, copy databases etc. */
#endif
#ifdef macintosh
! PMSMushSetup();
#endif
infile = restarting ? options.output_db : options.input_db;
--- 700,706 ----
Win32MUSH_setup(); /* create index files, copy databases etc. */
#endif
#ifdef macintosh
! PMSSetupDatabases();
#endif
infile = restarting ? options.output_db : options.input_db;
***************
*** 813,818 ****
--- 815,823 ----
/* now do access file stuff */
read_access_file();
+ /* initialize random number generator */
+ initialize_mt();
+
/* set up dumper */
strcpy(dumpfile, outfile);
init_timer();
***************
*** 1484,1490 ****
}
if (flags & DOL_NOTIFY) {
/* Execute a '@notify me' so the object knows we're done
! * with the list execution. We don't execute nfy_que()
* directly, since we want the command to be queued
* _after_ the list has executed.
*/
--- 1489,1495 ----
}
if (flags & DOL_NOTIFY) {
/* Execute a '@notify me' so the object knows we're done
! * with the list execution. We don't execute dequeue_semaphores()
* directly, since we want the command to be queued
* _after_ the list has executed.
*/
*** 1_7_5.98/src/funstr.c Mon, 28 Jan 2002 22:37:06 -0600 dunemush (pennmush/c/13_funstr.c 1.28.1.1.1.2.1.4.1.6.1.1.1.1.1.2.1.1.1.1.1.9 660)
--- 1_7_5.133(w)/src/funstr.c Tue, 19 Mar 2002 09:58:46 -0600 dunemush (pennmush/c/13_funstr.c 1.28.1.1.1.2.1.4.1.6.1.1.1.1.1.2.1.1.1.1.1.1.1.2 660)
***************
*** 248,253 ****
--- 248,254 ----
FUNCTION(fun_left)
{
int len;
+ ansi_string *as;
if (!is_integer(args[1])) {
safe_str(T(e_int), buff, bp);
***************
*** 260,266 ****
return;
}
! safe_ansi(args[0], len, buff, bp);
}
/* ARGSUSED */
--- 261,269 ----
return;
}
! as = parse_ansi_string(args[0]);
! safe_ansi_string(as, 0, len, buff, bp);
! free_ansi_string(as);
}
/* ARGSUSED */
***************
*** 281,287 ****
}
as = parse_ansi_string(args[0]);
! if (len > as->len)
safe_strl(args[0], arglens[0], buff, bp);
else
safe_ansi_string(as, as->len - len, as->len, buff, bp);
--- 284,290 ----
}
as = parse_ansi_string(args[0]);
! if ((size_t) len > as->len)
safe_strl(args[0], arglens[0], buff, bp);
else
safe_ansi_string(as, as->len - len, as->len, buff, bp);
***************
*** 308,314 ****
as = parse_ansi_string(args[0]);
! if (pos > as->len) {
/* Fast special case - concatenate args[2] to args[0] */
safe_strl(args[0], arglens[0], buff, bp);
safe_strl(args[2], arglens[0], buff, bp);
--- 311,317 ----
as = parse_ansi_string(args[0]);
! if ((size_t) pos > as->len) {
/* Fast special case - concatenate args[2] to args[0] */
safe_strl(args[0], arglens[0], buff, bp);
safe_strl(args[2], arglens[0], buff, bp);
***************
*** 345,351 ****
as = parse_ansi_string(args[0]);
! if (pos > as->len || num <= 0) {
safe_strl(args[0], arglens[0], buff, bp);
free_ansi_string(as);
return;
--- 348,354 ----
as = parse_ansi_string(args[0]);
! if ((size_t) pos > as->len || num <= 0) {
safe_strl(args[0], arglens[0], buff, bp);
free_ansi_string(as);
return;
***************
*** 419,424 ****
--- 422,428 ----
int p, n;
as = parse_ansi_string(args[0]);
+ populate_codes(as);
for (p = 0, n = as->len - 1; p < n; p++, n--) {
char *tcode;
***************
*** 531,536 ****
--- 535,546 ----
if (!*args[0])
return;
+ /* Special-case repeating one character */
+ if (arglens[0] == 1) {
+ safe_fill(args[0][0], times, buff, bp);
+ return;
+ }
+
/* Do the repeat in O(lg n) time. */
/* This takes advantage of the fact that we're given a BUFFER_LEN
* buffer for args[0] that we are free to trash. Huzzah! */
***************
*** 552,563 ****
{
int n, i, j;
ansi_string *as;
- int ansi_present = 0;
if (!*args[0])
return;
as = parse_ansi_string(args[0]);
n = as->len;
for (i = 0; i < n; i++) {
char t, *tcode;
--- 562,573 ----
{
int n, i, j;
ansi_string *as;
if (!*args[0])
return;
as = parse_ansi_string(args[0]);
+ populate_codes(as);
n = as->len;
for (i = 0; i < n; i++) {
char t, *tcode;
***************
*** 565,574 ****
t = as->text[j];
as->text[j] = as->text[i];
as->text[i] = t;
- if (!as->codes[i])
- as->codes[i] = strdup(ANSI_NORMAL);
- if (!as->codes[j])
- as->codes[j] = strdup(ANSI_NORMAL);
tcode = as->codes[j];
as->codes[j] = as->codes[i];
as->codes[i] = tcode;
--- 575,580 ----
***************
*** 582,604 ****
{
/* pads a string with trailing blanks (or other fill character) */
! int spaces;
char sep;
! if (!is_integer(args[1])) {
! safe_str(T(e_int), buff, bp);
return;
}
! spaces = parse_integer(args[1]) - ansi_strlen(args[0]);
if (spaces >= BUFFER_LEN)
spaces = BUFFER_LEN - 1;
if (!delim_check(buff, bp, nargs, args, 3, &sep))
return;
safe_strl(args[0], arglens[0], buff, bp);
! for (; spaces > 0; spaces--)
! safe_chr(sep, buff, bp);
}
/* ARGSUSED */
--- 588,616 ----
{
/* pads a string with trailing blanks (or other fill character) */
! size_t spaces, len;
char sep;
! if (!is_uinteger(args[1])) {
! safe_str(T(e_uint), buff, bp);
return;
}
! len = ansi_strlen(args[0]);
! spaces = parse_uinteger(args[1]);
if (spaces >= BUFFER_LEN)
spaces = BUFFER_LEN - 1;
+ if (len >= spaces) {
+ safe_strl(args[0], arglens[0], buff, bp);
+ return;
+ }
+ spaces -= len;
+
if (!delim_check(buff, bp, nargs, args, 3, &sep))
return;
safe_strl(args[0], arglens[0], buff, bp);
! safe_fill(sep, spaces, buff, bp);
}
/* ARGSUSED */
***************
*** 606,627 ****
{
/* pads a string with leading blanks (or other fill character) */
! int spaces;
char sep;
! if (!is_integer(args[1])) {
! safe_str(T(e_int), buff, bp);
return;
}
! spaces = parse_integer(args[1]) - ansi_strlen(args[0]);
if (spaces >= BUFFER_LEN)
spaces = BUFFER_LEN - 1;
if (!delim_check(buff, bp, nargs, args, 3, &sep))
return;
! for (; spaces > 0; spaces--)
! safe_chr(sep, buff, bp);
safe_strl(args[0], arglens[0], buff, bp);
}
--- 618,645 ----
{
/* pads a string with leading blanks (or other fill character) */
! size_t spaces, len;
char sep;
! if (!is_uinteger(args[1])) {
! safe_str(T(e_uint), buff, bp);
return;
}
! len = ansi_strlen(args[0]);
! spaces = parse_uinteger(args[1]);
if (spaces >= BUFFER_LEN)
spaces = BUFFER_LEN - 1;
+ if (len >= spaces) {
+ safe_strl(args[0], arglens[0], buff, bp);
+ return;
+ }
+ spaces -= len;
+
if (!delim_check(buff, bp, nargs, args, 3, &sep))
return;
! safe_fill(sep, spaces, buff, bp);
safe_strl(args[0], arglens[0], buff, bp);
}
***************
*** 630,643 ****
{
/* pads a string with leading blanks (or other fill character) */
! int lsp, rsp;
char sep;
! if (!is_integer(args[1])) {
! safe_str(T(e_int), buff, bp);
return;
}
! rsp = parse_integer(args[1]) - ansi_strlen(args[0]);
lsp = rsp / 2;
rsp -= lsp;
if (lsp >= BUFFER_LEN)
--- 648,667 ----
{
/* pads a string with leading blanks (or other fill character) */
! size_t width, len, lsp, rsp;
char sep;
! if (!is_uinteger(args[1])) {
! safe_str(T(e_uint), buff, bp);
! return;
! }
! width = parse_uinteger(args[1]);
! len = ansi_strlen(args[0]);
! if (len >= width) {
! safe_strl(args[0], arglens[0], buff, bp);
return;
}
! rsp = width - len;
lsp = rsp / 2;
rsp -= lsp;
if (lsp >= BUFFER_LEN)
***************
*** 648,658 ****
if (!delim_check(buff, bp, nargs, args, 3, &sep))
return;
! for (; lsp > 0; lsp--)
! safe_chr(sep, buff, bp);
safe_strl(args[0], arglens[0], buff, bp);
! for (; rsp > 0; rsp--)
! safe_chr(sep, buff, bp);
}
/* ARGSUSED */
--- 672,680 ----
if (!delim_check(buff, bp, nargs, args, 3, &sep))
return;
! safe_fill(sep, lsp, buff, bp);
safe_strl(args[0], arglens[0], buff, bp);
! safe_fill(sep, rsp, buff, bp);
}
/* ARGSUSED */
***************
*** 925,935 ****
}
s = parse_integer(args[0]);
! if (s >= BUFFER_LEN)
! s = BUFFER_LEN - 1;
!
! for (; s > 0; s--)
! safe_chr(' ', buff, bp);
}
/* ARGSUSED */
--- 947,953 ----
}
s = parse_integer(args[0]);
! safe_fill(' ', s, buff, bp);
}
/* ARGSUSED */
***************
*** 956,963 ****
safe_str(T(e_perm), buff, bp);
return;
}
! for (; k; k--)
! safe_chr(BEEP_CHAR, buff, bp);
}
/* All the safe tags from HTML 4.0 */
--- 974,980 ----
safe_str(T(e_perm), buff, bp);
return;
}
! safe_fill(BEEP_CHAR, k, buff, bp);
}
/* All the safe tags from HTML 4.0 */
*** 1_7_5.98/src/funlist.c Wed, 06 Feb 2002 23:25:21 -0600 dunemush (pennmush/c/16_funlist.c 1.3.1.1.1.5.1.2.1.1.1.1.1.4.1.2.1.2.1.19.1.2.1.1.1.2.1.5.1.1.1.1.1.1.1.1.1.1.2.2 660)
--- 1_7_5.133(w)/src/funlist.c Tue, 19 Mar 2002 09:58:46 -0600 dunemush (pennmush/c/16_funlist.c 1.3.1.1.1.5.1.2.1.1.1.1.1.4.1.2.1.2.1.19.1.2.1.1.1.2.1.5.1.1.1.1.1.1.1.1.1.1.2.1.1.3.1.3 660)
***************
*** 2372,2382 ****
* Optional parameters: field width, line length, delimiter, output sep
* Number of columns = line length / (field width+1)
*/
! int line_length = 78;
! int field_width = 10;
! int col = 0;
! int spaces;
char sep, osep, *cp, *t;
if (!delim_check(buff, bp, nargs, args, 5, &osep))
return;
--- 2372,2383 ----
* Optional parameters: field width, line length, delimiter, output sep
* Number of columns = line length / (field width+1)
*/
! Size_t line_length = 78;
! Size_t field_width = 10;
! Size_t col = 0;
! Size_t offset, col_len;
char sep, osep, *cp, *t;
+ ansi_string *as;
if (!delim_check(buff, bp, nargs, args, 5, &osep))
return;
***************
*** 2414,2439 ****
* send a return
*/
! cp = trim_space_sep(args[0], sep);
! if (!*cp)
return;
- col = field_width + !!osep;
t = split_token(&cp, sep);
! /*
! tp = tbuf1;
! len = ansi_strnlen(t, field_width);
! ansi_save(t + field_width - 1, -1, tbuf1, &tp);
! len = ansi_align(t, len);
! if (len < BUFFER_LEN)
! t[len] = '\0';
! safe_str(t, buff, bp);
! safe_str(tbuf1, buff, bp);
! */
! safe_ansi(t, field_width, buff, bp);
! for (spaces = field_width - ansi_strlen(t); spaces > 0; spaces--)
! if (safe_chr(' ', buff, bp))
! return;
while (cp) {
col += field_width + !!osep;
if (col > line_length) {
--- 2415,2439 ----
* send a return
*/
! as = parse_ansi_string(args[0]);
!
! cp = trim_space_sep(as->text, sep);
! if (!*cp) {
! free_ansi_string(as);
return;
+ }
t = split_token(&cp, sep);
! offset = t - &as->text[0];
! col_len = strlen(t);
! if (col_len > field_width)
! col_len = field_width;
! safe_ansi_string(as, offset, col_len, buff, bp);
! if (safe_fill(' ', field_width - col_len, buff, bp)) {
! free_ansi_string(as);
! return;
! }
! col = field_width + !!osep;
while (cp) {
col += field_width + !!osep;
if (col > line_length) {
***************
*** 2444,2464 ****
safe_chr(osep, buff, bp);
}
t = split_token(&cp, sep);
! /*
! tp = tbuf1;
! len = ansi_strnlen(t, field_width);
! ansi_save(t + field_width - 1, -1, tbuf1, &tp);
! len = ansi_align(t, len);
! if (len < BUFFER_LEN)
! t[len] = '\0';
! safe_str(t, buff, bp);
! safe_str(tbuf1, buff, bp);
! */
! safe_ansi(t, field_width, buff, bp);
! for (spaces = field_width - ansi_strlen(t); spaces > 0; spaces--)
! if (safe_chr(' ', buff, bp))
! return;
}
}
/* In the following regexp functions, we use pcre_study to potentially
--- 2444,2458 ----
safe_chr(osep, buff, bp);
}
t = split_token(&cp, sep);
! offset = t - &as->text[0];
! col_len = strlen(t);
! if (col_len > field_width)
! col_len = field_width;
! safe_ansi_string(as, offset, col_len, buff, bp);
! if (safe_fill(' ', field_width - col_len, buff, bp))
! break;
}
+ free_ansi_string(as);
}
/* In the following regexp functions, we use pcre_study to potentially
*** 1_7_5.98/src/flags.c Tue, 29 Jan 2002 10:15:12 -0600 dunemush (pennmush/c/20_flags.c 1.1.1.1.1.1.1.1.1.1.1.1.1.6.1.2.1.1.1.1.1.2.2.2.2.1.2.1.1.3.1.8 660)
--- 1_7_5.133(w)/src/flags.c Tue, 19 Mar 2002 09:58:46 -0600 dunemush (pennmush/c/20_flags.c 1.1.1.1.1.1.1.1.1.1.1.1.1.6.1.2.1.1.1.1.1.2.2.2.2.1.2.1.1.3.1.2.1.2 660)
***************
*** 394,400 ****
static char buf[BUFFER_LEN];
char *p;
! static const char type_codes[] = "R-EP--";
FLAG *f;
int t;
--- 394,400 ----
static char buf[BUFFER_LEN];
char *p;
! static const char type_codes[] = "RTEP--";
FLAG *f;
int t;
***************
*** 406,413 ****
return buf;
}
! if (t != TYPE_THING)
! *p++ = type_codes[t];
/* get generic flags */
for (f = flag_table; f->type == NOTYPE; f++) {
--- 406,412 ----
return buf;
}
! *p++ = type_codes[t];
/* get generic flags */
for (f = flag_table; f->type == NOTYPE; f++) {
***************
*** 799,809 ****
/* those who unDARK return to the WHO */
if ((f->flag == DARK) && (f->type == NOTYPE) && (IsPlayer(thing)))
hide_player(thing, 0);
! /* notify the area if something stops listening */
if (IsThing(thing) && (f->type == TYPE_THING) &&
! GoodObject(Location(thing)) &&
! (((f->flag == THING_PUPPET) && !listener && !Hearer(thing)) ||
! ((f->flag == THING_LISTEN) && !hear && !Listener(thing)))) {
sprintf(tbuf1, T("%s is no longer listening."), Name(thing));
notify_except(Contents(Location(thing)), NOTHING, tbuf1);
notify_except(Contents(thing), NOTHING, tbuf1);
--- 798,808 ----
/* those who unDARK return to the WHO */
if ((f->flag == DARK) && (f->type == NOTYPE) && (IsPlayer(thing)))
hide_player(thing, 0);
! /* notify the area if something stops listening, but only if it
! wasn't listening before */
if (IsThing(thing) && (f->type == TYPE_THING) &&
! GoodObject(Location(thing)) && (hear || listener) &&
! !Hearer(thing) && !Listener(thing)) {
sprintf(tbuf1, T("%s is no longer listening."), Name(thing));
notify_except(Contents(Location(thing)), NOTHING, tbuf1);
notify_except(Contents(thing), NOTHING, tbuf1);
*** 1_7_5.98/src/extmail.c Sun, 06 Jan 2002 20:56:21 -0600 dunemush (pennmush/c/22_extmail.c 1.44.1.8 660)
--- 1_7_5.133(w)/src/extmail.c Tue, 19 Mar 2002 09:58:46 -0600 dunemush (pennmush/c/22_extmail.c 1.44.1.7.1.5 660)
***************
*** 1445,1456 ****
dbref player;
int rc, uc, cc;
! if (nargs == 0) {
count_mail(executor, player_folder(executor), &rc, &uc, &cc);
! safe_integer(rc + uc, buff, bp);
! return;
! }
! if (nargs == 1) {
if (!is_integer(args[0])) {
/* handle the case of wanting to count the number of messages */
if ((player =
--- 1445,1455 ----
dbref player