[btech-checkins] CVS: btechmux/src bsd.c,1.3,1.4 comsys.c,1.12,1.13 db.c,1.4,1.5 db.h,1.1.1.1,1.2 ev
Brought to you by:
twouters
From: Thomas W. <two...@us...> - 2004-08-09 00:31:54
|
Update of /cvsroot/btech/btechmux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19526/src Modified Files: bsd.c comsys.c db.c db.h eval.c file_c.c functions.c game.c help.c macro.c mail.c p.db.h p.sa-db.h predicates.c wiz.c Log Message: Annual (ahem) sync with the BitKeeper btechmux tree (at btechmux.bkbits.net/btechmux). I should sync more often but I've been short on time. If you want to keep in touch with the changes, consider using BK directly. This sync contains these BK changesets (many merged from the stable tree in BitKeeper): # -------------------------------------------- # 03/09/30 th...@st... 1.13.1.12 # Reformat a bit (purely a whitspace change.) # -------------------------------------------- # 03/09/30 th...@st... 1.13.1.13 # Skip sections that have no internals, when calculating weight of a unit. The MUX treats these sections as 'nonexistant' in all other places, too, but it's still possible (albeit difficult) to get something into those sections, eating up phantom weight. # # -------------------------------------------- # 03/09/30 th...@st... 1.24 # Merge # -------------------------------------------- # 03/10/01 th...@st... 1.13.1.14 # Safeguard against a 'shouldn't-happen' scenario that seems to have happened several times now on 3030MUX. (but was probably just generic memory corruption.) # -------------------------------------------- # 03/10/01 th...@st... 1.25 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 03/10/01 th...@st... 1.26 # Remove duplicate maps that screw up case-insensitive systems. # -------------------------------------------- # 03/10/01 th...@st... 1.13.1.15 # Remove duplicate maps that screw up case-insensitive systems. # -------------------------------------------- # 03/10/01 th...@st... 1.13.1.16 # Also actally delete these dupes. # -------------------------------------------- # 03/10/01 th...@st... 1.27 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 03/10/01 th...@st... 1.13.3.1 # Rather than safeguard against something, do the proper fix :) wcAmmoItems was incremented twice, in some circumstances. That's not very healthy. Remove the safeguard, it serves no purpose other than protect against hardware errors or memory corruption, both of which would cause other problems anyhow. # -------------------------------------------- # 03/10/01 th...@st... 1.13.1.17 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/btechmux-stable # -------------------------------------------- # 03/10/01 th...@st... 1.28 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 03/10/01 th...@ce... 1.13.1.18 # Ice glitchfixes: break through it while standing, and don't survive as tank breaking ice. # -------------------------------------------- # 03/10/01 th...@ce... 1.13.1.19 # More ice glitch fixes: properly break ice when picking a unit (but not a MechWarrior) up through it. # -------------------------------------------- # 03/10/01 th...@st... 1.29 # Manual merge. # -------------------------------------------- # 03/10/01 th...@ce... 1.13.1.20 # Wups... don't sink hovertows. # -------------------------------------------- # 03/10/01 th...@st... 1.30 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 03/10/05 th...@st... 1.13.1.21 # Make MUX function 'btgetdbrefbyid' accept a map as well as a 'mech as its first argument. # -------------------------------------------- # 03/10/12 th...@st... 1.13.1.22 # - Fix bug in MechPrefs (MUX +bug #1152) and make sure it doesn't happen again. # - Add MechPrefs to xcodevalues. # # -------------------------------------------- # 03/10/12 th...@st... 1.31 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 03/10/12 th...@st... 1.13.1.23 # - Consider OOD-ing 'mechs as Jumping 'mechs where appropriate. # -------------------------------------------- # 03/10/14 th...@st... 1.13.1.24 # Add new 'c' option to LRS, for colorized terrain. # -------------------------------------------- # 03/10/14 th...@st... 1.32 # Manual merge. # -------------------------------------------- # 03/10/14 th...@st... 1.13.1.25 # Don't cliff hovers that go from l0 bridge to l1 bridge. # -------------------------------------------- # 03/10/14 th...@st... 1.13.1.26 # Don't drown vehicles that manage to break l0 ice. # -------------------------------------------- # 03/10/14 th...@st... 1.33 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 03/10/15 th...@st... 1.13.1.27 # Add tactical/lrs-like argument handling to navigate. You can now say 'navigate 120 1' to see the hex bearing 120 of you as if you were in it, or 'navigate qq' to see the navigate for 'Mech 'qq'. Max range is the same as for 'tactical'. # -------------------------------------------- # 03/10/18 th...@st... 1.13.1.28 # - Add 'tactical b', for displaying valid DropShip landing zones # - Add the ability to run 'checklz x y' for hexes in TacRange. # -------------------------------------------- # 03/10/18 th...@st... 1.34 # Merge 'tactical b' changes. # -------------------------------------------- # 03/10/18 th...@st... 1.35 # Typo fix. # -------------------------------------------- # 03/10/19 th...@st... 1.13.1.29 # - Add new 'btmechfreqs' function, returning the radio freqs on a 'Mech. It returns a comma separated list of entries, each of which is: # # <freqnum> | <frequency> | <freqflags> | <colorcode> # # Where freqnum starts at 1, frequency is the actual frequency set, colormode is the color setting for that channel (captial letters meaning bold), and freqflags is a bitvector-string with the following meaning: # # - 'a': Freq is digital # - 'b': Freq is muted # - 'c': Freq is set Relay # - 'd': Freq is set Info # - 'e': Freq is set Scan # # Comtitles are not returned because of escaping issues. # -------------------------------------------- # 03/10/19 th...@st... 1.36 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 03/10/19 th...@st... 1.13.1.30 # Make second argument to 'btstores' optional. When not passed, 'btstores' will return partname:amount pairs, separated by |'s, for all parts in the inventory of the object. # -------------------------------------------- # 03/10/19 th...@st... 1.37 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 03/10/19 th...@st... 1.13.1.31 # Patch from Tony to make tel() and @tel 'teleport' exits the same way the 'drop' command does. # -------------------------------------------- # 03/10/19 th...@st... 1.38 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 03/10/21 th...@st... 1.13.1.32 # Fix eternal loop when calling btdamagemech() with a 'clustersize' of 0. # -------------------------------------------- # 03/10/31 th...@st... 1.13.1.33 # Glitchfix. # -------------------------------------------- # 03/10/31 th...@st... 1.13.1.34 # Possibly fix memory corruption problems 3030 has been having, by fixing around tprintf (as suggested by Null @ 3029.) # -------------------------------------------- # 03/11/14 th...@ce... 1.13.4.1 # Fix buglet in btlostohex(): use proper range. # -------------------------------------------- # 03/11/15 th...@st... 1.13.1.35 # Fix possibly malicious crashing bug in macros. # -------------------------------------------- # 03/11/15 th...@st... 1.39 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 03/11/15 th...@ce... 1.13.1.36 # Merge http://btechmux.bkbits.net/btechmux-stable # into centurion.xs4all.nl:/home/thomas/btsrc/btechmux-stable # -------------------------------------------- # 03/11/15 th...@st... 1.40 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 03/11/20 th...@st... 1.13.1.37 # Misc cleanup fixes. Stuff that probably didn't cause any real-world bugs, but should be fixed anyway. # -------------------------------------------- # 03/11/23 th...@st... 1.13.1.38 # - Facilitate debugging by not closing stdin/stdout. Old behaviour can be had by defining CLOSE_STDIN somewhere, but I have no use for it yet. # - Zap rediculous 'filedecriptor caching' that just re-used fd0 for everything, brutally closing it if needed. I'm suprised this hasn't caused odd bugs where data went to the wrong file. Totally unnecessary. # - Various memory buglets found by Valgrind. Some things were obviously wrong but never went wrong thanks to the reliability of stack layout in GCC. Others were potentially wrong but probably never did any harm -- but I could be wrong. # # -------------------------------------------- # 04/02/02 th...@st... 1.41 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 04/02/09 th...@st... 1.13.1.39 # Fix off-by-one error in reading maps with an X size of MAPX (1000 by default.) # -------------------------------------------- # 04/02/10 th...@st... 1.13.1.40 # Open help/news files for reading, not writing. Oopsie from last changeset. # -------------------------------------------- # 04/02/12 th...@st... 1.42 # Merge conflicts. # -------------------------------------------- # 04/02/12 th...@st... 1.13.1.41 # remove unused file. # -------------------------------------------- # 04/02/12 th...@st... 1.43 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bt-stable-test # into stalker.xs4all.nl:/home/thomas/btsrc/bt-dev-test # -------------------------------------------- # 04/02/13 th...@st... 1.44 # Undo previous change that deletes map.build.functions.c. # -------------------------------------------- # 04/03/05 th...@ce... 1.13.5.1 # foobar changeset # -------------------------------------------- # 04/03/05 th...@ce... 1.13.5.2 # foobar2 # -------------------------------------------- # 04/05/08 th...@st... 1.13.1.42 # Properly display valid/invalid LZ's in 'tactical b' even when not using colours. Previously, the characters \240 and \241 (inverted exclamation mark and non-break space, respectively, in ISO 8859-1 and -15) were displayed. # # -------------------------------------------- # 04/05/08 th...@st... 1.13.1.43 # Protect some xcodevalues from being changed, to avoid memory corruption and the like. # -------------------------------------------- # 04/05/09 th...@st... 1.45 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 04/05/09 th...@st... 1.46 # SF patch #920275: Fixes a bug in mech.combat.c:FireWeapon(), from Martin Murray. # Fixes a crashing bug when firing on hexes. # -------------------------------------------- # 04/05/09 th...@st... 1.13.1.44 # Fix some buglets in previous fixes: don't close fd's that weren't opened, and when using memmove instead of strcpy, include the terminating NUL manually. # -------------------------------------------- # 04/05/09 th...@st... 1.47 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 04/05/09 th...@st... 1.13.1.45 # Fix typo in previous checkin, and compile before checking in. # -------------------------------------------- # 04/05/09 th...@st... 1.48 # Merge stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux-stable # into stalker.xs4all.nl:/home/thomas/btsrc/bitkeeper/btechmux # -------------------------------------------- # 04/05/11 th...@ce... 1.13.1.46 # Merge http://btechmux.bkbits.net/btechmux-stable # into centurion.xs4all.nl:/home/thomas/btsrc/btechmux-stable # -------------------------------------------- # 04/05/11 th...@ce... 1.13.1.47 # Fix compiler warnings: # - Add a few missing include files # - Remove unused variables # -------------------------------------------- # 04/05/11 th...@ce... 1.13.1.48 # Fix small loophole where you could tell an out-of-LOS unit's approximate location by triangulating 'out of arc' messages. Always give the same 'out of los' message for mechID's that are not in LOS, even if the mechID's don't exist or if they are out of range or out of arc. # -------------------------------------------- # 04/05/11 th...@st... 1.13.1.49 # Fix off-by-one error in the kick-decision range check in autopilots. # -------------------------------------------- # 04/07/29 th...@st... 1.13.1.50 # Attempt to improve the dieroll's randomness somewhat. # -------------------------------------------- # 04/08/09 th...@st... 1.49 # manual merge of stable branch with devel branch. # # -------------------------------------------- # Index: bsd.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/bsd.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** bsd.c 23 Jan 2002 21:20:24 -0000 1.3 --- bsd.c 9 Aug 2004 00:31:08 -0000 1.4 *************** *** 1213,1217 **** #ifdef HAVE_UNION_WAIT ! union wait stat; #else --- 1213,1217 ---- #ifdef HAVE_UNION_WAIT ! union wait stat = {0}; #else Index: comsys.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/comsys.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** comsys.c 8 Dec 2002 01:23:06 -0000 1.12 --- comsys.c 9 Aug 2004 00:31:08 -0000 1.13 *************** *** 1745,1749 **** { struct channel *ch; - struct comuser *user; static char smbuf[SBUF_SIZE]; --- 1745,1748 ---- Index: db.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/db.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** db.c 23 Jan 2002 21:20:24 -0000 1.4 --- db.c 9 Aug 2004 00:31:08 -0000 1.5 *************** *** 91,242 **** /* - * --------------------------------------------------------------------------- - * * Temp file management, used to get around static limits in some versions - * * of libc. - */ - - FILE *t_fd; - int t_is_pipe; - - #ifdef TLI - int t_is_tli; - - #endif - - static void tf_xclose(fd) - FILE *fd; - { - if (fd) { - if (t_is_pipe) - pclose(fd); - #ifdef TLI - else if (t_is_tli) - t_close(fd); - #endif - else - fclose(fd); - } else { - close(0); - } - t_fd = NULL; - t_is_pipe = 0; - } - - static int tf_fiddle(tfd) - int tfd; - { - if (tfd < 0) { - tfd = open(DEV_NULL, O_RDONLY, 0); - return -1; - } - if (tfd != 0) { - dup2(tfd, 0); - close(tfd); - } - return 0; - } - - static int tf_xopen(fname, mode) - char *fname; - int mode; - { - int fd; - - fd = open(fname, mode, 0600); - fd = tf_fiddle(fd); - return fd; - } - - /* - * #define t_xopen(f,m) t_fiddle(open(f, m, 0600)) - */ - - static const char *mode_txt(mode) - int mode; - { - switch (mode & O_ACCMODE) { - case O_RDONLY: - return "r"; - case O_WRONLY: - return "w"; - } - return "r+"; - } - - void NDECL(tf_init) - { - fclose(stdin); - tf_xopen(DEV_NULL, O_RDONLY); - t_fd = NULL; - t_is_pipe = 0; - } - - int tf_open(fname, mode) - char *fname; - int mode; - { - tf_xclose(t_fd); - return tf_xopen(fname, mode); - } - - #ifndef STANDALONE - - int tf_socket(fam, typ) - int fam, typ; - { - tf_xclose(t_fd); - return tf_fiddle(socket(fam, typ, 0)); - } - - #ifdef TLI - int tf_topen(fam, mode) - int fam, mode; - { - tf_xclose(t_fd); - return tf_fiddle(t_open(fam, mode, NULL)); - } - - #endif - #endif - - void tf_close(fdes) - int fdes; - { - tf_xclose(t_fd); - tf_xopen(DEV_NULL, O_RDONLY); - } - - FILE *tf_fopen(fname, mode) - char *fname; - int mode; - { - tf_xclose(t_fd); - if (tf_xopen(fname, mode) >= 0) { - t_fd = fdopen(0, mode_txt(mode)); - return t_fd; - } - return NULL; - } - - void tf_fclose(fd) - FILE *fd; - { - tf_xclose(t_fd); - tf_xopen(DEV_NULL, O_RDONLY); - } - - FILE *tf_popen(fname, mode) - char *fname; - int mode; - { - tf_xclose(t_fd); - t_fd = popen(fname, mode_txt(mode)); - if (t_fd != NULL) { - t_is_pipe = 1; - } - return t_fd; - } - - /* * #define GNU_MALLOC_TEST 1 */ --- 91,94 ---- *************** *** 2715,2718 **** --- 2567,2572 ---- s_Owner(thing, GOD); s_Flags(thing, (TYPE_GARBAGE | GOING)); + s_Flags2(thing, 0); + s_Flags3(thing, 0); s_Powers(thing, 0); s_Powers2(thing, 0); Index: db.h =================================================================== RCS file: /cvsroot/btech/btechmux/src/db.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** db.h 3 Jan 2002 00:59:28 -0000 1.1.1.1 --- db.h 9 Aug 2004 00:31:08 -0000 1.2 *************** *** 231,244 **** extern void FDECL(s_Pennies, (dbref, int)); - extern void NDECL(tf_init); - extern int FDECL(tf_open, (char *, int)); - extern int FDECL(tf_socket, (int, int)); - extern void FDECL(tf_close, (int)); - extern FILE *FDECL(tf_fopen, (char *, int)); - extern void FDECL(tf_fclose, (FILE *)); - extern FILE *FDECL(tf_popen, (char *, int)); - - #define tf_pclose(f) tf_fclose(f) - extern dbref FDECL(getref, (FILE *)); extern void FDECL(putref, (FILE *, dbref)); --- 231,234 ---- Index: eval.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/eval.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** eval.c 31 Jul 2002 14:53:04 -0000 1.3 --- eval.c 9 Aug 2004 00:31:08 -0000 1.4 *************** *** 183,187 **** break; case '[': ! if (cstr[-1] == ESC_CHAR) { first = 0; break; --- 183,187 ---- break; case '[': ! if (cstr != rstr && cstr[-1] == ESC_CHAR) { first = 0; break; Index: file_c.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/file_c.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** file_c.c 3 Jan 2002 00:59:54 -0000 1.1.1.1 --- file_c.c 9 Aug 2004 00:31:08 -0000 1.2 *************** *** 136,140 **** */ ! if ((fd = tf_open(filename, O_RDONLY)) == -1) { /* --- 136,140 ---- */ ! if ((fd = open(filename, O_RDONLY)) == -1) { /* *************** *** 149,153 **** ENDLOG; } - tf_close(fd); return -1; --- 149,152 ---- *************** *** 189,193 **** } free_lbuf(buff); ! tf_close(fd); /* --- 188,192 ---- } free_lbuf(buff); ! close(fd); /* Index: functions.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/functions.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** functions.c 30 Sep 2003 01:01:31 -0000 1.11 --- functions.c 9 Aug 2004 00:31:08 -0000 1.12 *************** *** 82,85 **** --- 82,86 ---- XFUNCTION(fun_btloadmap) XFUNCTION(fun_btloadmech) + XFUNCTION(fun_btmechfreqs) XFUNCTION(fun_cwho); XFUNCTION(fun_clist); *************** *** 2260,2264 **** FUNCTION(fun_mul) { ! int i, got_one; double prod; --- 2261,2265 ---- FUNCTION(fun_mul) { ! int i; double prod; *************** *** 5115,5119 **** {"BTMAKEPILOTROLL", fun_btmakepilotroll, 3, 0, CA_WIZARD}, {"BTSETXCODEVALUE", fun_btsetxcodevalue, 3, 0, CA_WIZARD}, ! {"BTSTORES", fun_btstores, 2, 0, CA_WIZARD}, {"BTDAMAGES", fun_btdamages, 1, 0, CA_WIZARD}, {"BTCRITSTATUS",fun_btcritstatus,2,0, CA_WIZARD}, --- 5116,5120 ---- {"BTMAKEPILOTROLL", fun_btmakepilotroll, 3, 0, CA_WIZARD}, {"BTSETXCODEVALUE", fun_btsetxcodevalue, 3, 0, CA_WIZARD}, ! {"BTSTORES", fun_btstores, 0, FN_VARARGS, CA_WIZARD}, {"BTDAMAGES", fun_btdamages, 1, 0, CA_WIZARD}, {"BTCRITSTATUS",fun_btcritstatus,2,0, CA_WIZARD}, *************** *** 5138,5141 **** --- 5139,5143 ---- {"BTLOADMAP", fun_btloadmap, 2, FN_VARARGS, CA_WIZARD}, {"BTLOADMECH", fun_btloadmech, 2, 0, CA_WIZARD}, + {"BTMECHFREQS", fun_btmechfreqs, 1, 0, CA_WIZARD}, #endif {"CAPSTR", fun_capstr, -1, 0, CA_PUBLIC}, Index: game.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/game.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** game.c 1 May 2002 15:11:14 -0000 1.4 --- game.c 9 Aug 2004 00:31:08 -0000 1.5 *************** *** 884,888 **** char *message; { ! int fd; ResetSpecialObjects(); --- 884,888 ---- char *message; { ! FILE * fs; ResetSpecialObjects(); *************** *** 904,912 **** log_text(message); ENDLOG; ! } fd = tf_open(mudconf.status_file, O_RDWR | O_CREAT | O_TRUNC); ! (void) write(fd, message, strlen(message)); ! (void) write(fd, (char *) "\n", 1); ! tf_close(fd); /* --- 904,912 ---- log_text(message); ENDLOG; ! } ! fs = fopen(mudconf.status_file, "w"); ! fprintf(fs, "%s\n", message); ! fclose(fs); /* *************** *** 962,969 **** if (dump_type == DUMP_CRASHED) { unlink(mudconf.crashdb); ! f = tf_fopen(mudconf.crashdb, O_WRONLY | O_CREAT | O_TRUNC); if (f != NULL) { db_write(f, F_MUX, UNLOAD_VERSION | UNLOAD_OUTFLAGS); ! tf_fclose(f); } else { log_perror("DMP", "FAIL", "Opening crash file", --- 962,969 ---- if (dump_type == DUMP_CRASHED) { unlink(mudconf.crashdb); ! f = fopen(mudconf.crashdb, "w"); if (f != NULL) { db_write(f, F_MUX, UNLOAD_VERSION | UNLOAD_OUTFLAGS); ! fclose(f); } else { log_perror("DMP", "FAIL", "Opening crash file", *************** *** 982,990 **** if (dump_type == DUMP_RESTART) { ! f = tf_fopen(mudconf.indb, O_WRONLY | O_CREAT | O_TRUNC); if (f != NULL) { /* Write a flatfile */ db_write(f, F_MUX, UNLOAD_VERSION | UNLOAD_OUTFLAGS); ! tf_fclose(f); } else { log_perror("DMP", "FAIL", "Opening restart file", --- 982,990 ---- if (dump_type == DUMP_RESTART) { ! f = fopen(mudconf.indb, "w"); if (f != NULL) { /* Write a flatfile */ db_write(f, F_MUX, UNLOAD_VERSION | UNLOAD_OUTFLAGS); ! fclose(f); } else { log_perror("DMP", "FAIL", "Opening restart file", *************** *** 1004,1012 **** if (dump_type == DUMP_KILLED) { sprintf(tmpfile, "%s.KILLED", mudconf.indb); ! f = tf_fopen(tmpfile, O_WRONLY | O_CREAT | O_TRUNC); if (f != NULL) { /* Write a flatfile */ db_write(f, F_MUX, UNLOAD_VERSION | UNLOAD_OUTFLAGS); ! tf_fclose(f); } else { log_perror("DMP", "FAIL", "Opening killed file", mudconf.indb); --- 1004,1012 ---- if (dump_type == DUMP_KILLED) { sprintf(tmpfile, "%s.KILLED", mudconf.indb); ! f = fopen(tmpfile, "w"); if (f != NULL) { /* Write a flatfile */ db_write(f, F_MUX, UNLOAD_VERSION | UNLOAD_OUTFLAGS); ! fclose(f); } else { log_perror("DMP", "FAIL", "Opening killed file", mudconf.indb); *************** *** 1044,1052 **** StringCopy(outfn, mudconf.outdb); strcat(outfn, ".gz"); ! f = tf_popen(tprintf("%s > %s", mudconf.compress, tmpfile), ! O_WRONLY); if (f) { db_write(f, F_MUX, OUTPUT_VERSION | OUTPUT_FLAGS); ! tf_pclose(f); rename(mudconf.outdb, prevfile); if (rename(tmpfile, outfn) < 0) --- 1044,1051 ---- StringCopy(outfn, mudconf.outdb); strcat(outfn, ".gz"); ! f = popen(tprintf("%s > %s", mudconf.compress, tmpfile), "w"); if (f) { db_write(f, F_MUX, OUTPUT_VERSION | OUTPUT_FLAGS); ! pclose(f); rename(mudconf.outdb, prevfile); if (rename(tmpfile, outfn) < 0) *************** *** 1060,1067 **** * VMS */ ! f = tf_fopen(tmpfile, O_WRONLY | O_CREAT | O_TRUNC); if (f) { db_write(f, F_MUX, OUTPUT_VERSION | OUTPUT_FLAGS); ! tf_fclose(f); rename(mudconf.outdb, prevfile); if (rename(tmpfile, mudconf.outdb) < 0) --- 1059,1066 ---- * VMS */ ! f = fopen(tmpfile, "w"); if (f) { db_write(f, F_MUX, OUTPUT_VERSION | OUTPUT_FLAGS); ! fclose(f); rename(mudconf.outdb, prevfile); if (rename(tmpfile, mudconf.outdb) < 0) *************** *** 1212,1217 **** strcat(infile, ".gz"); if (stat(infile, &statbuf) == 0) { ! if ((f = tf_popen(tprintf(" %s < %s", mudconf.uncompress, ! infile), O_RDONLY)) != NULL) compressed = 1; } --- 1211,1216 ---- strcat(infile, ".gz"); if (stat(infile, &statbuf) == 0) { ! if ((f = popen(tprintf(" %s < %s", mudconf.uncompress, ! infile), "r")) != NULL) compressed = 1; } *************** *** 1222,1226 **** if (compressed == 0) { StringCopy(infile, mudconf.indb); ! if ((f = tf_fopen(mudconf.indb, O_RDONLY)) == NULL) return -1; } --- 1221,1225 ---- if (compressed == 0) { StringCopy(infile, mudconf.indb); ! if ((f = fopen(mudconf.indb, "r")) == NULL) return -1; } *************** *** 1233,1243 **** log_text(infile); ENDLOG; ! } if (db_read(f, &db_format, &db_version, &db_flags) < 0) { STARTLOG(LOG_ALWAYS, "INI", "FATAL") { log_text((char *) "Error loading "); log_text(infile); ENDLOG; ! } return -1; } if (mudconf.have_comsys || mudconf.have_macros) load_comsys_and_macros(); --- 1232,1253 ---- log_text(infile); ENDLOG; ! }; ! if (db_read(f, &db_format, &db_version, &db_flags) < 0) { STARTLOG(LOG_ALWAYS, "INI", "FATAL") { log_text((char *) "Error loading "); log_text(infile); ENDLOG; ! } ! if (compressed) ! pclose(f); ! else ! fclose(f); ! return -1; } + if (compressed) + pclose(f); + else + fclose(f); + if (mudconf.have_comsys || mudconf.have_macros) load_comsys_and_macros(); *************** *** 1259,1273 **** * everything ok */ - #ifndef VMS - if (compressed) - tf_pclose(f); - else - tf_fclose(f); - #else - tf_fclose(f); - #endif /* - * VMS - */ - return (0); } --- 1269,1272 ---- *************** *** 1442,1448 **** exit(1); } fclose(stdin); fclose(stdout); ! #if defined(HAVE_IEEEFP_H) && defined(HAVE_SYS_UCONTEXT_H) --- 1441,1449 ---- exit(1); } + + #ifdef CLOSE_STDIN fclose(stdin); fclose(stdout); ! #endif #if defined(HAVE_IEEEFP_H) && defined(HAVE_SYS_UCONTEXT_H) *************** *** 1454,1458 **** #endif - tf_init(); #ifdef RADIX_COMPRESSION init_string_compress(); --- 1455,1458 ---- Index: help.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/help.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** help.c 7 Jan 2002 09:58:32 -0000 1.2 --- help.c 9 Aug 2004 00:31:08 -0000 1.3 *************** *** 59,63 **** hashflush(htab, 0); ! if ((fp = tf_fopen(filename, O_RDONLY)) == NULL) { STARTLOG(LOG_PROBLEMS, "HLP", "RINDX") { p = alloc_lbuf("helpindex_read.LOG"); --- 59,63 ---- hashflush(htab, 0); ! if ((fp = fopen(filename, "r")) == NULL) { STARTLOG(LOG_PROBLEMS, "HLP", "RINDX") { p = alloc_lbuf("helpindex_read.LOG"); *************** *** 114,118 **** free(htab_entry); } ! tf_fclose(fp); hashreset(htab); return count; --- 114,118 ---- free(htab_entry); } ! fclose(fp); hashreset(htab); return count; *************** *** 195,199 **** return; } ! if ((fp = tf_fopen(filename, O_RDONLY)) == NULL) { notify(player, "Sorry, that function is temporarily unavailable."); STARTLOG(LOG_PROBLEMS, "HLP", "OPEN") { --- 195,199 ---- return; } ! if ((fp = fopen(filename, "r")) == NULL) { notify(player, "Sorry, that function is temporarily unavailable."); STARTLOG(LOG_PROBLEMS, "HLP", "OPEN") { *************** *** 215,219 **** ENDLOG; } ! tf_fclose(fp); return; --- 215,219 ---- ENDLOG; } ! fclose(fp); return; *************** *** 240,244 **** notify(player, line); } ! tf_fclose(fp); free_lbuf(line); free_lbuf(result); --- 240,244 ---- notify(player, line); } ! fclose(fp); free_lbuf(line); free_lbuf(result); Index: macro.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/macro.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** macro.c 1 May 2002 15:11:14 -0000 1.2 --- macro.c 9 Aug 2004 00:31:08 -0000 1.3 *************** *** 528,538 **** cmd = alias; for (; *cmd && *cmd != ' ' && *cmd != '='; cmd++); ! if (!*cmd) { notify(player, "MACRO: You must specify an = in your macro definition"); return; } - while (*cmd && *cmd != '=') - *cmd++ = 0; *cmd++ = 0; while (*cmd && *cmd == ' ') --- 528,538 ---- cmd = alias; for (; *cmd && *cmd != ' ' && *cmd != '='; cmd++); ! while (*cmd && *cmd == ' ') ! *cmd++ = '\0'; ! if (*cmd != '=') { notify(player, "MACRO: You must specify an = in your macro definition"); return; } *cmd++ = 0; while (*cmd && *cmd == ' ') Index: mail.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/mail.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** mail.c 3 Jan 2002 01:00:12 -0000 1.1.1.1 --- mail.c 9 Aug 2004 00:31:08 -0000 1.2 *************** *** 2489,2493 **** { struct mail *mp, *nextp; ! struct tm then_tm; time_t then, now = time(0); time_t expire_secs = mudconf.mail_expiration * 86400; --- 2489,2493 ---- { struct mail *mp, *nextp; ! struct tm then_tm = { 0 }; time_t then, now = time(0); time_t expire_secs = mudconf.mail_expiration * 86400; Index: p.db.h =================================================================== RCS file: /cvsroot/btech/btechmux/src/p.db.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** p.db.h 3 Jan 2002 01:00:08 -0000 1.1.1.1 --- p.db.h 9 Aug 2004 00:31:08 -0000 1.2 *************** *** 14,24 **** /* db.c */ - void tf_init(void); - int tf_open(char *fname, int mode); - int tf_socket(int fam, int typ); - void tf_close(int fdes); - FILE *tf_fopen(char *fname, int mode); - void tf_fclose(FILE * fd); - FILE *tf_popen(char *fname, int mode); void fwdlist_set(dbref thing, FWDLIST * ifp); void fwdlist_clr(dbref thing); --- 14,17 ---- Index: p.sa-db.h =================================================================== RCS file: /cvsroot/btech/btechmux/src/p.sa-db.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** p.sa-db.h 3 Jan 2002 00:59:30 -0000 1.1.1.1 --- p.sa-db.h 9 Aug 2004 00:31:08 -0000 1.2 *************** *** 14,23 **** /* sa-db.c */ - void tf_init(void); - int tf_open(char *fname, int mode); - void tf_close(int fdes); - FILE *tf_fopen(char *fname, int mode); - void tf_fclose(FILE * fd); - FILE *tf_popen(char *fname, int mode); int fwdlist_load(FWDLIST * fp, dbref player, char *atext); int fwdlist_rewrite(FWDLIST * fp, char *atext); --- 14,17 ---- Index: predicates.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/predicates.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** predicates.c 3 Jan 2002 00:59:30 -0000 1.1.1.1 --- predicates.c 9 Aug 2004 00:31:08 -0000 1.2 *************** *** 41,45 **** #endif { ! static char buff[20000]; va_list ap; --- 41,45 ---- #endif { ! static char buff[LBUF_SIZE]; va_list ap; *************** *** 53,57 **** #endif ! vsprintf(buff, format, ap); va_end(ap); buff[LBUF_SIZE - 1] = '\0'; --- 53,57 ---- #endif ! vsnprintf(buff, LBUF_SIZE, format, ap); va_end(ap); buff[LBUF_SIZE - 1] = '\0'; *************** *** 66,70 **** #endif { ! static char buff[20000]; va_list ap; --- 66,70 ---- #endif { ! static char buff[LBUF_SIZE]; va_list ap; *************** *** 86,90 **** */ ! vsprintf(buff, format, ap); va_end(ap); buff[LBUF_SIZE - 1] = '\0'; --- 86,90 ---- */ ! vsnprintf(buff, LBUF_SIZE, format, ap); va_end(ap); buff[LBUF_SIZE - 1] = '\0'; Index: wiz.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/wiz.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** wiz.c 30 Sep 2003 01:01:31 -0000 1.2 --- wiz.c 9 Aug 2004 00:31:08 -0000 1.3 *************** *** 44,48 **** char *arg1, *arg2; { ! dbref victim, destination, loc; char *to; int hush = 0; --- 44,48 ---- char *arg1, *arg2; { ! dbref victim, destination, loc, exitloc; char *to; int hush = 0; *************** *** 74,78 **** */ ! if (!Has_location(victim)) { notify_quiet(player, "You can't teleport that."); return; --- 74,78 ---- */ ! if (!Has_location(victim) && Typeof(victim) != TYPE_EXIT) { notify_quiet(player, "You can't teleport that."); return; *************** *** 88,95 **** } /* ! * Check for teleporting home */ ! if (!string_compare(to, "home")) { (void) move_via_teleport(victim, HOME, cause, 0); return; --- 88,96 ---- } /* ! * Check for teleporting home ! * Also, can't teleport exits 'home' */ ! if (!string_compare(to, "home") && Typeof(victim) != TYPE_EXIT) { (void) move_via_teleport(victim, HOME, cause, 0); return; *************** *** 126,131 **** /* * If fascist teleport is on, you must control the victim's ultimate ! * * * * * location (after LEAVEing any objects) or it must be ! * JUMP_OK. */ --- 127,131 ---- /* * If fascist teleport is on, you must control the victim's ultimate ! * location (after LEAVEing any objects) or it must be JUMP_OK. */ *************** *** 167,175 **** hush = HUSH_ENTER | HUSH_LEAVE; ! if (move_via_teleport(victim, destination, cause, hush)) { ! if (player != victim) { ! if (!Quiet(player)) notify_quiet(player, "Teleported."); - } } } else if (isExit(destination)) { --- 167,181 ---- hush = HUSH_ENTER | HUSH_LEAVE; ! if (Typeof(victim) == TYPE_EXIT) { ! exitloc = Exits(victim); ! s_Exits(exitloc, remove_first(Exits(exitloc), victim)); ! s_Exits(destination, insert_first(Exits(destination), victim)); ! s_Exits(victim, destination); ! ! if (!Quiet(player)) ! notify_quiet(player, "Exit teleported."); ! } else if (move_via_teleport(victim, destination, cause, hush)) { ! if (player != victim && !Quiet(player)) notify_quiet(player, "Teleported."); } } else if (isExit(destination)) { |