PennMUSH Community

Changeset 407

Show
Ignore:
Timestamp:
08/12/06 16:52:53 (2 years ago)
Author:
pennmush
Message:

PennMUSH 1.7.7p4 Archival

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 1.7.7/CHANGES

    r405 r407  
    1818 
    1919========================================================================== 
     20 
     21Version 1.7.7 patchlevel 4                      January 2, 2003 
     22 
     23Minor Changes: 
     24  * When room_connects is on, @aconnect and @adisconnect also  
     25    functions on things when players (dis)connect inside them.  
     26    Suggested by Philip Mak. [SW] 
     27  * Parser-enforced argument counts for user-defined @functions, 
     28    as an option to @function. 
     29Config: 
     30  * New mush.cnf option max_global_fns allows increasing the number 
     31    of @functions allowed without editing source code. If you change 
     32    this, you should reboot the MUSH or bad things can happen. 
     33    Suggested by hilikiradi@Dardalani. 
     34Fixes: 
     35  * mkcmds.sh doesn't always regenerate every file, only what's 
     36    needed. Speeds up compiles. Suggested by Philip Mak. [SW] 
     37  * Fixes from 1.7.6p4. 
     38 
    2039 
    2140Version 1.7.7 patchlevel 3                      December 25, 2002 
  • 1.7.7/Makefile.SH

    r357 r407  
    6161    (cd src; make all "CC=$(CC)" "CCFLAGS=$(CCFLAGS)" \ 
    6262    "LDFLAGS=$(LDFLAGS)" "CLIBS=$(CLIBS)" "MAKE=$(MAKE)" \ 
    63     "MAKEFLAGS=$(MAKEFLAGS)"; rm -f ../hdrs/timestamp
     63    "MAKEFLAGS=$(MAKEFLAGS)"
    6464    @echo "If the make was successful, use 'make install' to install links." 
    6565 
     
    7575 
    7676hdrs/cmds.h: src/cmds.c src/command.c src/cque.c src/help.c src/set.c 
    77     (cd utils; sh mkcmds.sh
     77    (cd utils; sh mkcmds.sh commands
    7878 
    7979hdrs/switches.h: src/SWITCHES 
    80     (cd utils; sh mkcmds.sh
    81  
    82 src/switchinc.c: src/SWITCHES 
    83    (cd utils; sh mkcmds.sh
    84  
    85 hdrs/funs.h: src/fun*.c 
    86     (cd utils; sh mkcmds.sh
     80    (cd utils; sh mkcmds.sh switches
     81 
     82#src/switchinc.c: hdrs/switches.h 
     83#  (cd utils; sh mkcmds.sh switches
     84 
     85hdrs/funs.h: src/fun*.c src/bsd.c src/conf.c src/extmail.c src/help.c src/wiz.c 
     86    (cd utils; sh mkcmds.sh functions
    8787 
    8888hdrs/patches.h: patches/* 
    89     (cd utils; sh mkcmds.sh
     89    (cd utils; sh mkcmds.sh patches
    9090 
    9191install: localized all 
     
    223223 
    224224dist.tar: distclean versions 
    225     -rm -f hdrs/timestamp 
    226225    (cd utils; sh mkcmds.sh) 
    227226    makedist -c pennmush 
  • 1.7.7/Patchlevel

    r405 r407  
    11Do not edit this file. It is maintained by the official PennMUSH patches. 
    2 This is PennMUSH 1.7.7p3 
     2This is PennMUSH 1.7.7p4 
  • 1.7.7/game/mushcnf.dst

    r403 r407  
    189189# What's the max chain length of indirect locks allowed? 
    190190max_depth 10 
     191 
     192# How many @functions can we have? If you change this without # doing a 
     193# shutdown (or shutdown/reboot) immediately thereafter, you'll very likely 
     194# crash your MUSH, so don't do that. 
     195max_global_fns 50 
    191196 
    192197# How much does it cost a mortal to create a channel? 
     
    410415global_connects yes 
    411416 
    412 # trigger @aconnect/@adisconnect in the room? 
     417# trigger @aconnect/@adisconnect in a connecting player's location 
     418# if the location is a room or thing? 
    413419room_connects no 
    414420 
  • 1.7.7/game/txt/hlp/penncmd.hlp

    r405 r407  
    12551255& @function 
    12561256  @function [<function name>] 
    1257   @function <function name>=<object>,<attribute> 
     1257  @function <function name>=<object>,<attribute>[,<min args>, <max args>] 
    12581258    or @function <function name>=<object>/<attribute> 
    12591259  @function/<switch> <function name> 
     
    12861286  Functions defined via @function should follow the format used by 
    12871287  UFUN() - %0 is the first argument passed, %1 is the second argument 
    1288   passed, and so forth. 
     1288  passed, and so forth. Option third and fourth arguments to @function 
     1289  can be used to set a parser-enforced number of arguments for the function. 
    12891290   
    12901291  Example: 
     
    13251326  @function/delete ansi 
    13261327  &ansi_fun #1234=%0 
    1327   @function ansi=#1234, ansi_fun 
     1328  @function ansi=#1234, ansi_fun, 2, 2 
    13281329 
    13291330 will create a new version of ansi() that doesn't do any 
    1330  colorization. 
     1331 colorization, and that requires it to be called with exactly 
     1332 2 arguments, like the built-in version. 
    13311333 
    13321334See also: RESTRICT, FUNCTIONS, @startup 
  • 1.7.7/game/txt/hlp/pennfunc.hlp

    r403 r407  
    18251825    F   -   Return #-1 if what's found is of a different type than the 
    18261826            preferred one. 
    1827     X   -   Never return #-2. Use the last dbref found if the match is 
     1827    X   -   Never return #-2. Use the last dbref found if the match is   
    18281828            ambiguous. 
    18291829  If you specify more than one type, the last one will be preferred. Unless 
  • 1.7.7/game/txt/hlp/penntop.hlp

    r403 r407  
    17831783    * my <obj> - an object you're carrying 
    17841784    * this <obj> - an object in your location (also: this here <obj>) 
     1785    * toward <exit> - an exit in your location 
    17851786    * 1st, 2nd, etc. <obj> - one of a set of objects with the same names. 
    17861787      Objects are ordered in the order in which they're listed in your 
    1787       inventory or room contents
    1788    You may combine some adjectives (my 1st box, this here 2nd box
     1788      inventory, room contents, and exit list (in that order)
     1789   You may combine some adjectives (my 1st box, this here 2nd box)
    17891790& &HELP 
    17901791This is the AHELP index. 
  • 1.7.7/game/txt/hlp/pennvers.hlp

    r405 r407  
    11& changes 
    2 & 1.7.7p3 
     2& 1.7.7p4 
    33This is a list of changes in this patchlevel which are probably of 
    44interest to players. More information about new commands and functions 
     
    1212be read in 'help patchlevels'. 
    1313 
     14Version 1.7.7 patchlevel 4                      January 2, 2003 
     15 
     16Minor Changes: 
     17  * When room_connects is on, @aconnect and @adisconnect also  
     18    functions on things when players (dis)connect inside them.  
     19    Suggested by Philip Mak. [SW] 
     20  * Parser-enforced argument counts for user-defined @functions, 
     21    as an option to @function. 
     22Config: 
     23  * New mush.cnf option max_global_fns allows increasing the number 
     24    of @functions allowed without editing source code. If you change 
     25    this, you should reboot the MUSH or bad things can happen. 
     26    Suggested by hilikiradi@Dardalani. 
     27Fixes: 
     28  * mkcmds.sh doesn't always regenerate every file, only what's 
     29    needed. Speeds up compiles. Suggested by Philip Mak. [SW] 
     30  * Fixes from 1.7.6p4. 
     31 
     32 
     33& 1.7.7p3 
    1434Version 1.7.7 patchlevel 3                      December 25, 2002 
    1535 
     
    581601  * Indentation fixes [SW] 
    582602  * Fixes up to 1.7.4p12 merged in. 
     603 
     604& 1.7.6p4 
     605Version 1.7.6 patchlevel 4                      January 2, 2003 
     606 
     607Minor Changes: 
     608   * English-style matching now applies to exits in the room 
     609     (so '1st down' can match the first 'down' exit if you're not carrying 
     610     anything that matches 'down'). New english-style matching adjective 
     611     'toward' restricts the match to exits (so: 'look toward 1st down'). 
     612Fixes: 
     613   * Code cleanup to fix several potential buffer overflows. 
     614   * The wildcard matcher had problems with backslash escapes in 
     615     some cases, making matching a : in a $command very hard. 
     616     Reported by Wayne@PDX. 
     617   * @chzone could cause crashes on some systems.  Reported by Wayne@PDX. 
     618   * When two exits match, one is no longer chosen at random. 
     619     Instead, the ambiguity should be reported as an error. 
     620     Reported by Intrevis@M*U*S*H. 
     621   * The dbref returned by locate when given the X parameter is 
     622     no longer random, but the last one found (as per the help). 
     623   * Serious bug in reading locks from the db on startup corrected. 
     624   * The profiling timer is turned off duing dumps, as some systems 
     625     (FreeBSD?) appear to continue to use it and interrupt dumps 
     626     due to cpu limiting. Reported by Nathan Schuette. 
     627 
    583628 
    584629& 1.7.6p3 
     
    58855930type 'help <version>p<patchlevel>'. For example, 'help 1.7.2p3' 
    58865931 
    5887 1.7.7: 0, 1, 2, 3 
    5888 1.7.6: 0, 1, 2, 3 
     59321.7.7: 0, 1, 2, 3, 4 
     59331.7.6: 0, 1, 2, 3, 4 
    588959341.7.5: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 
    589059351.7.4: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 
  • 1.7.7/hdrs/conf.h

    r403 r407  
    221221  int queue_entry_cpu_time; 
    222222  int ascii_names; 
     223  int max_global_fns; 
    223224}; 
    224225 
     
    347348#define NEWLINE_ONE_CHAR (options.newline_one_char) 
    348349#define ONLY_ASCII_NAMES (options.ascii_names) 
    349  
     350#define MAX_GLOBAL_FNS (options.max_global_fns) 
    350351 
    351352/* Compiler-specific stuff. */ 
  • 1.7.7/hdrs/externs.h

    r403 r407  
    179179extern void moveto(dbref what, dbref where); 
    180180extern void safe_tel(dbref player, dbref dest, int nomovemsgs); 
    181 extern dbref global_exit(dbref player, const char *direction); 
    182 extern dbref remote_exit(dbref loc, const char *direction); 
     181extern int global_exit(dbref player, const char *direction); 
     182extern int remote_exit(dbref loc, const char *direction); 
    183183extern void move_wrapper(dbref player, const char *command); 
    184184extern void do_follow(dbref player, const char *arg); 
  • 1.7.7/hdrs/function.h

    r399 r407  
    3131 
    3232 
    33 /* Number of user @functions */ 
    34 #define MAX_GLOBAL_FNS 50 
    35  
    3633#ifndef HAVE_FUN_DEFINED 
    3734typedef struct fun FUN; 
     
    6562}; 
    6663 
    67 extern USERFN_ENTRY userfn_tab[MAX_GLOBAL_FNS]
     64extern USERFN_ENTRY *userfn_tab
    6865 
    6966extern void do_userfn(char *buff, char **bp, 
     
    8683extern void do_function_report(dbref player, char *name); 
    8784extern void do_function_delete(dbref player, char *name); 
    88  
     85extern void function_init_postconfig(void); 
    8986 
    9087 
  • 1.7.7/hdrs/game.h

    r401 r407  
    160160/* From timer.c */ 
    161161extern void init_timer(void); 
     162extern void signal_cpu_limit(int signo); 
    162163 
    163164/* From version.c */ 
  • 1.7.7/hdrs/lock.h

    r399 r407  
    5555int add_lock(dbref player, dbref thing, lock_type type, struct boolexp *key, 
    5656         int flags); 
     57int add_lock_raw(dbref player, dbref thing, lock_type type, 
     58         struct boolexp *key, int flags); 
    5759void free_locks(lock_list *ll); 
    5860int eval_lock(dbref player, dbref thing, lock_type ltype); 
     
    6567const char *lock_flags(lock_list *ll); 
    6668const char *lock_flags_long(lock_list *ll); 
    67  
    6869#define L_FLAGS(lock) ((lock)->flags) 
    6970#define L_CREATOR(lock) ((lock)->creator) 
     
    7172#define L_KEY(lock) ((lock)->key) 
    7273#define L_NEXT(lock) ((lock)->next) 
    73  
    7474/* can p read/evaluate lock l on object x? */ 
    7575int lock_visual(dbref, lock_type); 
     
    7777    (See_All(p) || controls(p,x) || ((Visual(x) || lock_visual(x, l)) && \ 
    7878     eval_lock(p,x,Examine_Lock))) 
    79  
    8079/* The actual magic cookies. */ 
    8180extern const lock_type Basic_Lock; 
     
    102101extern const lock_type Destroy_Lock;    /* Who can @dest me if I'm dest_ok? */ 
    103102/* Declare new lock types here! */ 
    104  
    105103#include "boolexp.h" 
    106  
    107104#endif              /* __LOCK_H */ 
  • 1.7.7/hdrs/version.h

    r405 r407  
    1 #define VERSION "PennMUSH version 1.7.7 patchlevel 3 [12/25/2002]" 
    2 #define SHORTVN "PennMUSH 1.7.7p3
     1#define VERSION "PennMUSH version 1.7.7 patchlevel 4 [01/02/2003]" 
     2#define SHORTVN "PennMUSH 1.7.7p4
  • 1.7.7/src/Makefile

    r399 r407  
    193193../hdrs/patches.h: 
    194194    if [ ! -f ../hdrs/patches.h ]; then \ 
    195       (cd ../utils; sh mkcmds.sh); \ 
     195      (cd ../utils; sh mkcmds.sh patches); \ 
    196196    fi 
    197197 
  • 1.7.7/src/bsd.c

    r403 r407  
    45594559  if (ROOM_CONNECTS) { 
    45604560    /* Do the room the player connected into */ 
    4561     if (IsRoom(loc)) { 
     4561    if (IsRoom(loc) || IsThing(loc)) { 
    45624562      (void) queue_attribute(loc, "ACONNECT", player); 
    45634563    } 
     
    46374637    (void) queue_attribute(player, "ADISCONNECT", player); 
    46384638    if (ROOM_CONNECTS) 
    4639       if (IsRoom(loc)) { 
     4639      if (IsRoom(loc) || IsThing(loc)) { 
    46404640    (void) queue_attribute(loc, "ADISCONNECT", player); 
    46414641      } 
  • 1.7.7/src/conf.c

    r401 r407  
    327327  {"queue_entry_cpu_time", cf_int, &options.queue_entry_cpu_time, 100000, 0, 
    328328   "limits"} 
     329  , 
     330  {"max_global_fns", cf_int, &options.max_global_fns, 2000, 0, 0} 
    329331  , 
    330332 
     
    925927  options.max_depth = 10; 
    926928  options.max_parents = 10; 
     929  options.max_global_fns = 50; 
    927930  options.purge_interval = 601; 
    928931  options.dbck_interval = 599; 
  • 1.7.7/src/db.c

    r405 r407  
    10221022    /* boolexp */ 
    10231023    b = getboolexp(f, type); 
    1024     add_lock(creator, i, type, b, flags); 
     1024    add_lock_raw(creator, i, type, b, flags); 
    10251025  } 
    10261026} 
     
    10501050      return; 
    10511051    } else { 
    1052       add_lock(Owner(i), i, buf, b, -1); 
     1052      add_lock_raw(Owner(i), i, buf, b, -1); 
    10531053    } 
    10541054  } 
  • 1.7.7/src/extmail.c

    r403 r407  
    416416 
    417417  struct mail *mp; 
    418   char tbuf1[BUFFER_LEN]
     418  char tbuf1[BUFFER_LEN], *bp
    419419  char folderheader[BUFFER_LEN]; 
    420420  struct mail_selector ms; 
     
    444444      strcpy(folderheader, T("Folder:")); 
    445445    notify(player, DASH_LINE); 
     446    bp = tbuf1; 
    446447    if (IsPlayer(mp->from)) 
    447       sprintf(tbuf1, "%s", Name(mp->from)); 
     448      safe_str(Name(mp->from), tbuf1, &bp); 
    448449    else 
    449       sprintf(tbuf1, "%s (owner: %s)", Name(mp->from), 
    450           Name(Owner(mp->from))); 
     450      safe_format(tbuf1, &bp, "%s (owner: %s)", Name(mp->from), 
     451              Name(Owner(mp->from))); 
     452    *bp = '\0'; 
    451453    notify_format(player, 
    452454              T 
  • 1.7.7/src/flags.c

    r403 r407  
    691691    GoodObject(Location(thing)) && (hear || listener) && 
    692692    !Hearer(thing) && !Listener(thing)) { 
    693       sprintf(tbuf1, T("%s is no longer listening."), Name(thing)); 
     693      tp = tbuf1; 
     694      safe_format(tbuf1, &tp, T("%s is no longer listening."), Name(thing)); 
     695      *tp = '\0'; 
    694696      notify_except(Contents(Location(thing)), NOTHING, tbuf1); 
    695697      notify_except(Contents(thing), NOTHING, tbuf1); 
     
    697699    if (IsRoom(thing) && (f->type == TYPE_ROOM) && 
    698700    (f->flag == ROOM_LISTEN) && !hear && !Listener(thing)) { 
    699       sprintf(tbuf1, T("%s is no longer listening."), Name(thing)); 
     701      tp = tbuf1; 
     702      safe_format(tbuf1, &tp, T("%s is no longer listening."), Name(thing)); 
     703      *tp = '\0'; 
    700704      notify_except(Contents(thing), NOTHING, tbuf1); 
    701705    } 
     
    704708      case TYPE_EXIT: 
    705709    if (Audible(Source(thing))) { 
    706       sprintf(tbuf1, T("Exit %s is no longer broadcasting."), Name(thing)); 
     710      tp = tbuf1; 
     711      safe_format(tbuf1, &tp, T("Exit %s is no longer broadcasting."), 
     712              Name(thing)); 
     713      *tp = '\0'; 
    707714      notify_except(Contents(Source(thing)), NOTHING, tbuf1); 
    708715    } 
     
    755762    ((f->flag == THING_PUPPET) || (f->flag == THING_LISTEN)) && 
    756763    !hear && !listener) { 
    757       sprintf(tbuf1, T("%s is now listening."), Name(thing)); 
     764      tp = tbuf1; 
     765      safe_format(tbuf1, &tp, T("%s is now listening."), Name(thing)); 
     766      *tp = '\0'; 
    758767      notify_except(Contents(Location(thing)), NOTHING, tbuf1); 
    759768      notify_except(Contents(thing), NOTHING, tbuf1); 
     
    761770    if (IsRoom(thing) && (f->type == TYPE_ROOM) && 
    762771    (f->flag == ROOM_LISTEN) && !hear && !listener) { 
    763       sprintf(tbuf1, T("%s is now listening."), Name(thing)); 
     772      tp = tbuf1; 
     773      safe_format(tbuf1, &tp, T("%s is now listening."), Name(thing)); 
     774      *tp = '\0'; 
    764775      notify_except(Contents(thing), NOTHING, tbuf1); 
    765776    } 
     
    769780      case TYPE_EXIT: 
    770781    if (Audible(Source(thing))) { 
    771       sprintf(tbuf1, T("Exit %s is now broadcasting."), Name(thing)); 
     782      tp = tbuf1; 
     783      safe_format(tbuf1, &tp, T("Exit %s is now broadcasting."), 
     784              Name(thing)); 
     785      *tp = '\0'; 
    772786      notify_except(Contents(Source(thing)), NOTHING, tbuf1); 
    773787    } 
  • 1.7.7/src/function.c

    r403 r407  
    55#include <string.h> 
    66#include <ctype.h> 
     7#include <stdlib.h> 
    78#include "conf.h" 
    89#include "attrib.h" 
     
    2728extern void local_functions(void); 
    2829 
     30USERFN_ENTRY *userfn_tab; 
    2931HASHTAB htab_function; 
    3032HASHTAB htab_user_function; 
     
    567569 
    568570void 
    569 init_func_hashtab(
     571init_func_hashtab(void
    570572{ 
    571573  FUNTAB *ftp; 
     
    577579  } 
    578580  local_functions(); 
     581} 
     582 
     583void 
     584function_init_postconfig(void) 
     585{ 
     586  userfn_tab = 
     587    (USERFN_ENTRY *) mush_malloc(MAX_GLOBAL_FNS * sizeof(USERFN_ENTRY), 
     588                 "userfn_tab"); 
    579589} 
    580590 
     
    681691 */ 
    682692 
    683 USERFN_ENTRY userfn_tab[MAX_GLOBAL_FNS]; 
    684693 
    685694static Size_t userfn_count = 0; 
     
    760769do_function(dbref player, char *name, char *argv[]) 
    761770{ 
    762   /* Command of format: @function <function name>=<thing>,<attribute> 
     771  /* Command of format: @function <function name>=<thing>,<attribute>[,<minargs>,<maxargs>] 
    763772   * or @function <function name>=<thing>/<attribute> 
    764773   * Adds a new user-defined function. 
     
    844853  fp = func_hash_lookup(upcasestr(name)); 
    845854  if (!fp) { 
    846     if (userfn_count >= MAX_GLOBAL_FNS) { 
     855    if (userfn_count >= (Size_t) MAX_GLOBAL_FNS) { 
    847856      notify(player, T("Function table full.")); 
    848857      return; 
     
    852861    fp->name = mush_strdup(name, "func_hash.name"); 
    853862    fp->where.offset = userfn_count; 
    854     fp->minargs = 0; 
    855     fp->maxargs = 10; 
     863    if (argv[3] && *argv[3]) { 
     864      fp->minargs = parse_integer(argv[3]); 
     865      if (fp->minargs < 0) 
     866    fp->minargs = 0; 
     867      else if (fp->minargs > 10) 
     868    fp->minargs = 10; 
     869    } else 
     870      fp->minargs = 0; 
     871 
     872    if (argv[4] && *argv[4]) { 
     873      fp->maxargs = parse_integer(argv[4]); 
     874      if (fp->maxargs < -10) 
     875    fp->maxargs = -10; 
     876      else if (fp->maxargs > 10) 
     877    fp->maxargs = 10; 
     878    } else 
     879      fp->maxargs = 10; 
    856880    fp->flags = 0; 
    857881    hashadd(name, fp, &htab_user_function); 
     
    874898    } 
    875899    if (fp->flags & FN_BUILTIN) {   /* Overriding a built in function */ 
    876       if (userfn_count >= MAX_GLOBAL_FNS) { 
     900      if (userfn_count >= (Size_t) MAX_GLOBAL_FNS) { 
    877901    notify(player, T("Function table full.")); 
    878902    return; 
     
    881905      fp->name = mush_strdup(name, "func_hash.name"); 
    882906      fp->where.offset = userfn_count; 
    883       fp->minargs = 0; 
    884       fp->maxargs = 10; 
    885907      fp->flags = 0; 
    886908      userfn_count++; 
     
    893915    userfn_tab[fp->where.offset].name = 
    894916      mush_strdup(upcasestr(argv[2]), "userfn_tab.name"); 
     917    if (argv[3] && *argv[3]) { 
     918      fp->minargs = parse_integer(argv[3]); 
     919      if (fp->minargs < 0) 
     920    fp->minargs = 0; 
     921      else if (fp->minargs > 10) 
     922    fp->minargs = 10; 
     923    } else 
     924      fp->minargs = 0; 
     925 
     926    if (argv[4] && *argv[4]) { 
     927      fp->maxargs = parse_integer(argv[4]); 
     928      if (fp->maxargs < -10) 
     929    fp->maxargs = -10; 
     930      else if (fp->maxargs > 10) 
     931    fp->maxargs = 10; 
     932    } else 
     933      fp->maxargs = 10; 
    895934    notify(player, T("Function updated.")); 
    896935  } 
     
    11401179  } 
    11411180 
    1142  
    1143  
    1144  
    1145  
    1146  
    11471181  *tp = '\0'; 
    11481182  notify_format(player, T("Flags     : %s"), tbuf); 
    11491183 
    1150   if (fp->flags & FN_BUILTIN) { 
    1151     maxargs = fp->maxargs; 
    1152     if (maxargs < 0) 
    1153       maxargs = -maxargs; 
    1154     tp = tbuf; 
    1155  
    1156     if (fp->maxargs < 0) { 
    1157       safe_str(T("(Commas okay in last argument)"), tbuf, &tp); 
    1158       *tp = '\0'; 
    1159     } else 
    1160       tbuf[0] = '\0'; 
    1161  
    1162     if (fp->minargs == maxargs) 
    1163       notify_format(player, T("Arguments : %d %s"), fp->minargs, tbuf); 
    1164     else if (fp->maxargs == INT_MAX) 
    1165       notify_format(player, T("Arguments : At least %d %s"), fp->minargs, tbuf); 
    1166     else 
    1167       notify_format(player, 
    1168             T("Arguments : %d to %d %s"), fp->minargs, maxargs, tbuf); 
    1169   } else { 
    1170     if (Global_Funcs(player)) 
    1171       notify_format(player, T("Location  : #%d/%s"), 
    1172             userfn_tab[fp->where.offset].thing, 
    1173             userfn_tab[fp->where.offset].name); 
    1174     notify(player, T("Arguments : 0 to 10")); 
    1175   } 
    1176 
     1184  if (!(fp->flags & FN_BUILTIN) && Global_Funcs(player)) { 
     1185    notify_format(player, T("Location  : #%d/%s"), 
     1186          userfn_tab[fp->where.offset].thing, 
     1187          userfn_tab[fp->where.offset].name); 
     1188  } 
     1189 
     1190  maxargs = abs(fp->maxargs); 
     1191 
     1192  tp = tbuf; 
     1193 
     1194  if (fp->maxargs < 0) { 
     1195    safe_str(T("(Commas okay in last argument)"), tbuf, &tp); 
     1196    *tp = '\0'; 
     1197  } else 
     1198    tbuf[0] = '\0'; 
     1199 
     1200  if (fp->minargs == maxargs) 
     1201    notify_format(player, T("Arguments : %d %s"), fp->minargs, tbuf); 
     1202  else if (fp->maxargs == INT_MAX) 
     1203    notify_format(player, T("Arguments : At least %d %s"), fp->minargs, tbuf); 
     1204  else 
     1205    notify_format(player, 
     1206          T("Arguments : %d to %d %s"), fp->minargs, maxargs, tbuf); 
     1207
  • 1.7.7/src/game.c

    r403 r407  
    324324  FILE *f = NULL; 
    325325 
     326#ifndef WIN32 
     327  ignore_signal(SIGPROF); 
     328#endif 
     329#ifdef I_SETJMP 
    326330  if (setjmp(db_err)) { 
    327331    /* The dump failed. Disk might be full or something went bad with the 
     
    330334    flag_broadcast(WIZARD | ROYALTY, 0, 
    331335           T("GAME: ERROR! Database save failed!")); 
     336#ifdef HAS_ITIMER 
     337    install_sig_handler(SIGPROF, signal_cpu_limit); 
     338#endif 
    332339  } else { 
    333340    local_dump_database(); 
     
    402409  } 
    403410 
     411#endif 
     412#ifdef HAS_ITIMER 
     413  install_sig_handler(SIGPROF, signal_cpu_limit); 
     414#endif 
    404415} 
    405416 
     
    618629  config_file_startup(conf); 
    619630  command_init_postconfig(); 
     631  function_init_postconfig(); 
    620632} 
    621633 
  • 1.7.7/src/lock.c

    r401 r407  
    383383} 
    384384 
     385/* Set the lock type on thing to boolexp. 
     386 * Used only on db load, when we can't safely test the player's 
     387 * permissions because they're not loaded yet. 
     388 */ 
     389int 
     390add_lock_raw(dbref player, dbref thing, lock_type type, struct boolexp *key, 
     391         int flags) 
     392{ 
     393  lock_list *ll, **t; 
     394  lock_type real_type = type; 
     395 
     396  if (!GoodObject(thing)) { 
     397    return 0; 
     398  } 
     399 
     400  ll = next_free_lock(); 
     401  if (!ll) { 
     402    /* Oh, this sucks */ 
     403    do_log(LT_ERR, 0, 0, "Unable to malloc memory for lock_list!"); 
     404  } else { 
     405    real_type = st_insert(type, &lock_names); 
     406    ll->type = real_type; 
     407    ll->key = key; 
     408    ll->creator = player; 
     409    if (flags == -1) { 
     410      const lock_list *l2 = get_lockproto(real_type); 
     411      if (l2) 
     412    ll->flags = l2->flags; 
     413      else 
     414    ll->flags = 0; 
     415    } else { 
     416      ll->flags = flags; 
     417    } 
     418    t = &Locks(thing); 
     419    while (*t && strcmp(L_TYPE(*t), L_TYPE(ll)) < 0) 
     420      t = &L_NEXT(*t); 
     421    L_NEXT(ll) = *t; 
     422    *t = ll; 
     423  } 
     424  return 1; 
     425} 
     426 
    385427/* Very primitive. */ 
    386428static void 
  • 1.7.7/src/log.c

    r399 r407  
    4545    dbref object; 
    4646{ 
    47   static char buff[BUFFER_LEN]
     47  static char buff[BUFFER_LEN], *bp
    4848 
    4949  switch (object) { 
    5050  case NOTHING: 
    51     sprintf(buff, T("*NOTHING*")); 
     51    strcpy(buff, T("*NOTHING*")); 
    5252    break; 
    5353  case AMBIGUOUS: 
    54     sprintf(buff, T("*VARIABLE*")); 
     54    strcpy(buff, T("*VARIABLE*")); 
    5555    break; 
    5656  case HOME: 
    57     sprintf(buff, T("*HOME*")); 
     57    strcpy(buff, T("*HOME*")); 
    5858    break; 
    5959  default: 
    60     sprintf(buff, "%s(#%d%s)", 
    61         Name(object), object, unparse_flags(object, GOD)); 
     60    bp = buff; 
     61    safe_format(buff, &bp, "%s(#%d%s)", 
     62        Name(object), object, unparse_flags(object, GOD)); 
     63    *bp = '\0'; 
    6264  } 
    6365 
  • 1.7.7/src/look.c

    r403 r407  
    655655{ 
    656656  static char buf[BUFFER_LEN]; 
     657  char *bp; 
    657658  CHANLIST *c; 
    658659 
    659660  if ((c = Chanlist(player))) { 
    660     strcpy(buf, T("Channels:")); 
    661     for (; c; c = c->next) 
    662       sprintf(buf, "%s %s", buf, ChanName(c->chan)); 
     661    bp = buf; 
     662    safe_str(T("Channels:"), buf, &bp); 
     663    for (; c; c = c->next) { 
     664      safe_chr(' ', buf, &bp); 
     665      safe_str(ChanName(c->chan), buf, &bp); 
     666    } 
     667    *bp = '\0'; 
    663668  } else 
    664669    strcpy(buf, T("Channels: *NONE*")); 
  • 1.7.7/src/match.c

    r399 r407  
    7777                  dbref *last_match, int *match_count); 
    7878static dbref match_exit(const dbref who, const char *name, 
    79             const int type, const long int flags); 
     79            const int type, const long int flags, int *match_count); 
    8080static dbref match_exit_internal(const dbref match_who, 
    8181                 const char *match_name, const int type, 
     
    9393              long int flags, dbref thing1, dbref thing2, 
    9494              int *match_count); 
     95extern int check_alias(const char *command, const char *list);  /* game.c */ 
    9596 
    9697 
     
    205206      match_remote_contents(who, name, type, flags, &last_match, &match_count); 
    206207    if (GoodObject(match)) { 
    207       exact_match_count++
     208      exact_match_count += match_count
    208209      exact_match = match; 
    209210    } 
     
    212213    match = match_neighbor(who, name, type, flags, &last_match, &match_count); 
    213214    if (GoodObject(match)) { 
    214       exact_match_count++
     215      exact_match_count += match_count
    215216      exact_match = match; 
    216217    } 
     
    219220    match = match_possession(who, name, type, flags, &last_match, &match_count); 
    220221    if (GoodObject(match)) { 
    221       exact_match_count++
     222      exact_match_count += match_count
    222223      exact_match = match; 
    223224    } 
    224225  } 
    225226  if (flags & MAT_EXIT) { 
    226     match = match_exit(who, name, type, flags); 
     227    match = match_exit(who, name, type, flags, &match_count); 
    227228    if (GoodObject(match)) { 
    228       exact_match_count++
     229      exact_match_count += match_count
    229230      exact_match = match; 
    230231    } 
     
    233234    match = match_container(who, name, type, flags, &last_match, &match_count); 
    234235    if (GoodObject(match)) { 
    235       exact_match_count++
     236      exact_match_count += match_count
    236237      exact_match = match; 
    237238    } 
     
    240241    match = match_exit_internal(who, name, type, flags, who, &match_count); 
    241242    if (GoodObject(match)) { 
    242       exact_match_count++
     243      exact_match_count += match_count
    243244      exact_match = match; 
    244245    } 
    245246  } 
    246   if ((flags & MAT_ENGLISH) && !GoodObject(last_match) 
    247       && !GoodObject(exact_match)) { 
     247  if ((flags & MAT_ENGLISH) && !GoodObject(exact_match) 
     248      && !((flags & MAT_LAST) && GoodObject(last_match))) { 
    248249    match = match_english(who, name, flags); 
    249250    if (GoodObject(match)) { 
     
    360361  DOLIST(first, first) { 
    361362    if (first == absolute) { 
     363      (*match_count)++; 
    362364      return first; 
    363365    } else if (!strcasecmp(Name(first), match_name) || 
     
    367369     * make sure match_count is high enough that we report ambiguity 
    368370     */ 
    369     *match_count += 2; 
    370371    *last_match = 
    371372      choose_thing(match_who, type, flags, the_match, first, match_count); 
    372373    return NOTHING; 
    373       } else 
     374      } else { 
    374375    the_match = first; 
     376    (*match_count)++; 
     377      } 
    375378    } else if (string_match(Name(first), match_name)) { 
    376379      *last_match = 
     
    413416 
    414417static dbref 
    415 match_exit(who, name, type, flags
     418match_exit(who, name, type, flags, match_count
    416419    const dbref who; 
    417420    const char *name; 
    418421    const int type; 
    419422    const long flags; 
     423    int *match_count; 
    420424{ 
    421425  dbref loc; 
     
    424428    if (flags & MAT_REMOTES) { 
    425429      if (GoodObject(loc)) 
    426     return match_exit_internal(who, name, type, flags, Zone(loc), NULL); 
     430    return match_exit_internal(who, name, type, flags, Zone(loc), 
     431                   match_count); 
    427432      else 
    428433    return NOTHING; 
    429434    } else if (flags & MAT_GLOBAL) 
    430       return match_exit_internal(who, name, type, flags, MASTER_ROOM, NULL); 
    431   } 
    432   return match_exit_internal(who, name, type, flags, loc, NULL); 
     435      return match_exit_internal(who, name, type, flags, MASTER_ROOM, 
     436                 match_count); 
     437  } 
     438  return match_exit_internal(who, name, type, flags, loc, match_count); 
    433439} 
    434440 
     
    444450  dbref exit_tmp; 
    445451  dbref absolute; 
    446   const char *match; 
    447   const char *p; 
    448452  dbref the_match = NOTHING; 
    449453 
     
    454458  absolute = match_absolute(match_name); 
    455459  DOLIST(exit_tmp, Exits(loc)) { 
    456     if (exit_tmp == absolute) { 
     460    if (exit_tmp == absolute) 
    457461      the_match = exit_tmp; 
    458     } else { 
    459       match = Name(exit_tmp); 
    460       while (*match) { 
    461     /* check out this one */ 
    462     for (p = match_name; (*p && DOWNCASE(*p) == DOWNCASE(*match) 
    463                   && *match != EXIT_DELIMITER); p++, match++) ; 
    464     /* did we get it? */ 
    465     if (*p == '\0') { 
    466       /* make sure there's nothing afterwards */ 
    467       while (isspace((unsigned char) *match)) 
    468         match++; 
    469       if (*match == '\0' || *match == EXIT_DELIMITER) { 
    470         /* we got it */ 
    471         the_match = 
    472           choose_thing(match_who, type, flags, the_match, exit_tmp, 
    473                match_count); 
    474         goto next_exit; 
    475       } 
    476     } 
    477     /* we didn't get it, find next match */ 
    478     while (*match && *match++ != EXIT_DELIMITER) ; 
    479     while (isspace((unsigned char) *match)) 
    480       match++; 
    481       } 
    482     } 
    483   next_exit: 
    484     ; 
     462    else if (check_alias(match_name, Name(exit_tmp))) 
     463      the_match =