This is patch08 to PennMUSH 1.8.3. After applying this patch, you will have version 1.8.3p9 To apply this patch, save it to a file in your top-level 1.8.3p7 MUSH directory, and do the following: patch -p0 < 1.8.3-patch09 ./configure make install If you use GNU patch 2.2, you probably want the above to be 'patch -b -p0', not just 'patch -p0'. Unix (or cygwin) users need not worry about failed hunks in src/switchinc.c, hdrs/switches.h, hdrs/cmds.h, or hdrs/funs.h. These files are automatically rebuilt on compile. On the off chance they appear not to be, simply rm them and re-run make. Then @shutdown/reboot your MUSH. - Shawn/Raevnos In this patch: * Starting up without an existing database was broken in p8. Reported by many people. [SW] * p8 didn't compile for many people for a number of reasons. [SW] * match() was broken. Reported by Kimiko. [SW] CHANGES.183 | 9 ++ Patchlevel | 2 aclocal.m4 | 4 - configure | 149 ++++++++++++++++++++++++++++++++++++++-------- configure.in | 60 +++++++++++++++--- game/txt/hlp/pennv183.hlp | 12 +++ game/txt/hlp/pennvOLD.hlp | 2 hdrs/version.h | 6 - src/chunk.c | 4 - src/db.c | 2 src/funlist.c | 9 +- src/game.c | 33 +++++----- src/help.c | 1 13 files changed, 227 insertions(+), 66 deletions(-) Prereq: 1.8.3p8 =================================================================== --- Patchlevel (.../p8) (revision 1426) +++ Patchlevel (.../p9) (revision 1426) @@ -1,3 +1,3 @@ Do not edit this file. It is maintained by the official PennMUSH patches. -This is PennMUSH 1.8.3p8 +This is PennMUSH 1.8.3p9 Index: configure =================================================================== --- configure (.../p8) (revision 1426) +++ configure (.../p9) (revision 1426) @@ -3977,7 +3977,11 @@ fi -ac_ext=cpp +case "${build_os}" in + *linux*) + # These might be linux-specific and aren't always caught as not + # supported by configure + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -4508,7 +4512,7 @@ : - LDFLAGS="$LDFLAGS -Wl,-z,noexecstack" + LDFLAGS="$LDFLAGS -Wl,-z,noexecstack" else @@ -4606,7 +4610,7 @@ : - CFLAGS="$CFLAGS -Wa,--noexecstack" + CFLAGS="$CFLAGS -Wa,--noexecstack" else @@ -4617,7 +4621,8 @@ fi - + ;; +esac if test "${CTAGS+set}" != "set" -a "${EXCTAGS+set}" = "set"; then @@ -13698,7 +13703,6 @@ - # Check whether --with-sqlite3 was given. if test "${with_sqlite3+set}" = set; then withval=$with_sqlite3; @@ -13762,12 +13766,6 @@ saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $ac_sqlite3_cppflags" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -13781,7 +13779,7 @@ { #if (SQLITE_VERSION_NUMBER >= $sqlite3_version_req_number) -// Everything is okay +/* Everything is okay */ #else # error SQLite version is too old #endif @@ -13807,7 +13805,7 @@ cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { - test -z "$ac_cxx_werror_flag" || + test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then @@ -13828,12 +13826,6 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - CPPFLAGS="$saved_CPPFLAGS" @@ -16433,9 +16425,7 @@ - - -for ac_func in pread pwrite posix_fadvise posix_fallocate +for ac_func in pread pwrite do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -16535,6 +16525,115 @@ fi done +# Some linux OSes (Old redhat, others?) will see these functions +# through an AC_CHECK_FUNCS but not when it comes time to actually use +# them in source. +{ $as_echo "$as_me:$LINENO: checking for posix_fallocate" >&5 +$as_echo_n "checking for posix_fallocate... " >&6; } +cat >conftest.$ac_ext <<_ACEOF + +#define _XOPEN_SOURCE 600 +#include + +int +main(void) +{ + posix_fallocate(0, 0, 100); + return 0; +} + +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +cat >>confdefs.h <<\_ACEOF +#define HAVE_POSIX_FALLOCATE 1 +_ACEOF + +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: checking for posix_fadvise and associated constants" >&5 +$as_echo_n "checking for posix_fadvise and associated constants... " >&6; } +cat >conftest.$ac_ext <<_ACEOF + +#define _XOPEN_SOURCE 600 +#include + +int +main(void) +{ + posix_fadvise(0, 0, 0, POSIX_FADV_SEQUENTIAL); + return 0; +} + +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +cat >>confdefs.h <<\_ACEOF +#define HAVE_POSIX_FADVISE 1 +_ACEOF + +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext @@ -18265,13 +18364,13 @@ if test "$enable_sql" = yes; then sql_servers="" if test "$found_mysql" = yes; then - sql_servers+="MySQL " + sql_servers="MySQL " fi if test "$found_postgresql" = yes; then - sql_servers+="Postgres " + sql_servers="${sql_servers} Postgres " fi if test "$found_sqlite" = yes; then - sql_servers+="Sqlite3 " + sql_servers="${sql_servers} Sqlite3 " fi echo "* SQL support: ${sql_servers:-No}" else Index: src/db.c =================================================================== --- src/db.c (.../p8) (revision 1426) +++ src/db.c (.../p9) (revision 1426) @@ -22,6 +22,7 @@ #endif #include #include +#include #include "conf.h" #include "dbio.h" #include "externs.h" @@ -2032,6 +2033,7 @@ #ifdef HAVE_LIBZ OUTPUT(gzputs(f->handle.g, s)); #endif + break; } return 0; } Index: src/chunk.c =================================================================== --- src/chunk.c (.../p8) (revision 1426) +++ src/chunk.c (.../p9) (revision 1426) @@ -211,13 +211,11 @@ #include "config.h" #include "conf.h" +#define _XOPEN_SOURCE 600 #include #include #include #include - - -#define _XOPEN_SOURCE 600 #include #include #include Index: src/funlist.c =================================================================== --- src/funlist.c (.../p8) (revision 1426) +++ src/funlist.c (.../p9) (revision 1426) @@ -1554,16 +1554,17 @@ char *s, *r; char sep; int wcount = 1; - size_t len; - char needle[BUFFER_LEN]; + char needle[BUFFER_LEN], haystack[BUFFER_LEN]; if (!delim_check(buff, bp, nargs, args, 3, &sep)) return; - strncpy(needle, remove_markup(args[1], &len), BUFFER_LEN); + strncpy(haystack, remove_markup(args[0], NULL), BUFFER_LEN); + strncpy(needle, remove_markup(args[1], NULL), BUFFER_LEN); + /* Walk the wordstring, until we find the word we want. */ - s = trim_space_sep(remove_markup(args[0], &len), sep); + s = trim_space_sep(haystack, sep); do { r = split_token(&s, sep); if (quick_wild(needle, r)) { Index: src/game.c =================================================================== --- src/game.c (.../p8) (revision 1426) +++ src/game.c (.../p9) (revision 1426) @@ -815,25 +815,24 @@ /* read small text files into cache */ fcache_init(); - f = db_open(infile); - - if (!f) { + if (setjmp(db_err) == 1) { do_rawlog(LT_ERR, "Couldn't open %s! Creating minimal world.", infile); init_compress(NULL); create_minimal_db(); return 0; + } else { + f = db_open(infile); + c = penn_fgetc(f); + if (c == EOF) { + do_rawlog(LT_ERR, "Couldn't read %s! Creating minimal world.", infile); + init_compress(NULL); + create_minimal_db(); + return 0; + } + + penn_ungetc(c, f); } - c = penn_fgetc(f); - if (c == EOF) { - do_rawlog(LT_ERR, "Couldn't read %s! Creating minimal world.", infile); - init_compress(NULL); - create_minimal_db(); - return 0; - } - - penn_ungetc(c, f); - if (setjmp(db_err) == 0) { /* ok, read it in */ do_rawlog(LT_ERR, "ANALYZING: %s", infile); @@ -2215,6 +2214,7 @@ pf->type = PFT_GZFILE; pf->handle.g = gzopen(filename, "rb"); if (!pf->handle.g) { + do_rawlog(LT_ERR, "Unable to open %s with libz: %s\n", filename, strerror(errno)); mush_free(pf, "pennfile"); longjmp(db_err, 1); } @@ -2250,8 +2250,10 @@ { pf->type = PFT_FILE; pf->handle.f = fopen(filename, FOPEN_READ); + if (!pf->handle.f) + do_rawlog(LT_ERR, "Unable to open %s: %s\n", filename, strerror(errno)); #ifdef HAVE_POSIX_FADVISE - if (pf->handle.f) + else if (pf->handle.f) posix_fadvise(fileno(pf->handle.f), 0, 0, POSIX_FADV_SEQUENTIAL); #endif @@ -2300,6 +2302,7 @@ pf->type = PFT_GZFILE; pf->handle.g = gzopen(filename, "wb"); if (!pf->handle.g) { + do_rawlog(LT_ERR, "Unable to open %s with libz: %s\n", filename, strerror(errno)); mush_free(pf, "pennfile"); longjmp(db_err, 1); } @@ -2327,6 +2330,8 @@ { pf->type = PFT_FILE; pf->handle.f = fopen(filename, "wb"); + if (!pf->handle.f) + do_rawlog(LT_ERR, "Unable to open %s: %s\n", filename, strerror(errno)); } if (!pf->handle.f) { mush_free(pf, "pennfile"); Index: src/help.c =================================================================== --- src/help.c (.../p8) (revision 1426) +++ src/help.c (.../p9) (revision 1426) @@ -6,6 +6,7 @@ * */ #include "config.h" +#define _XOPEN_SOURCE 600 #include #include #include Index: game/txt/hlp/pennv183.hlp =================================================================== --- game/txt/hlp/pennv183.hlp (.../p8) (revision 1426) +++ game/txt/hlp/pennv183.hlp (.../p9) (revision 1426) @@ -1,4 +1,4 @@ -& 1.8.3p8 +& 1.8.3p9 & changes This is a list of changes in this patchlevel which are probably of interest to players. More information about new commands and functions @@ -11,6 +11,16 @@ A list of the patchlevels associated with each release can be read in 'help patchlevels'. +Version 1.8.3 patchlevel 9 Feb 28, 2009 + +Fixes: + * Starting up without an existing database was broken in p8. + Reported by many people. [SW] + * p8 didn't compile for many people for a number of reasons. + [SW] + * match() was broken. Reported by Kimiko. [SW] + +& 1.8.3p8 Version 1.8.3 patchlevel 8 Feb 26, 2009 Major changes: Index: game/txt/hlp/pennvOLD.hlp =================================================================== --- game/txt/hlp/pennvOLD.hlp (.../p8) (revision 1426) +++ game/txt/hlp/pennvOLD.hlp (.../p9) (revision 1426) @@ -4417,7 +4417,7 @@ For information on a specific patchlevel of one of the versions listed, type 'help p'. For example, 'help 1.7.2p3' -1.8.3: 0, 1, 2, 3, 4, 5, 6, 7, 8 +1.8.3: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 1.8.2: 0, 1, 2, 3, 4, 5, 6, 7, 8 1.8.1: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 1.8.0: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 Index: CHANGES.183 =================================================================== --- CHANGES.183 (.../p8) (revision 1426) +++ CHANGES.183 (.../p9) (revision 1426) @@ -15,6 +15,15 @@ ========================================================================== +Version 1.8.3 patchlevel 9 Feb 28, 2009 + +Fixes: + * Starting up without an existing database was broken in p8. + Reported by many people. [SW] + * p8 didn't compile for many people for a number of reasons. + [SW] + * match() was broken. Reported by Kimiko. [SW] + Version 1.8.3 patchlevel 8 Feb 26, 2009 Major changes: Index: configure.in =================================================================== --- configure.in (.../p8) (revision 1426) +++ configure.in (.../p9) (revision 1426) @@ -73,13 +73,18 @@ AX_GCC_OPTION([-fstack-protector], [], [], [ CFLAGS="$CFLAGS -fstack-protector" ], []) -AX_LD_CHECK_FLAG([-Wl,-z,noexecstack], [], [], [ - LDFLAGS="$LDFLAGS -Wl,-z,noexecstack" -], []) -AX_LD_CHECK_FLAG([-Wa,--noexecstack], [], [], [ - CFLAGS="$CFLAGS -Wa,--noexecstack" -], []) - +case "${build_os}" in + *linux*) + # These might be linux-specific and aren't always caught as not + # supported by configure + AX_LD_CHECK_FLAG([-Wl,-z,noexecstack], [], [], [ + LDFLAGS="$LDFLAGS -Wl,-z,noexecstack" + ], []) + AX_LD_CHECK_FLAG([-Wa,--noexecstack], [], [], [ + CFLAGS="$CFLAGS -Wa,--noexecstack" + ], []) + ;; +esac if test "${CTAGS+set}" != "set" -a "${EXCTAGS+set}" = "set"; then @@ -244,7 +249,40 @@ AC_CHECK_FUNCS([getuid geteuid seteuid getpriority setpriority]) AC_CHECK_FUNCS([socketpair sigaction sigprocmask posix_memalign writev]) AC_CHECK_FUNCS([fcntl pselect poll ppoll pollts kqueue epoll_ctl inotify_init]) -AC_CHECK_FUNCS([pread pwrite posix_fadvise posix_fallocate]) +AC_CHECK_FUNCS([pread pwrite]) +# Some linux OSes (Old redhat, others?) will see these functions +# through an AC_CHECK_FUNCS but not when it comes time to actually use +# them in source. +AC_MSG_CHECKING([for posix_fallocate]) +AC_LINK_IFELSE([ +#define _XOPEN_SOURCE 600 +#include + +int +main(void) +{ + posix_fallocate(0, 0, 100); + return 0; +} +], +[AC_MSG_RESULT(yes)] +[AC_DEFINE(HAVE_POSIX_FALLOCATE)], +AC_MSG_RESULT(no)) +AC_MSG_CHECKING([for posix_fadvise and associated constants]) +AC_LINK_IFELSE([ +#define _XOPEN_SOURCE 600 +#include + +int +main(void) +{ + posix_fadvise(0, 0, 0, POSIX_FADV_SEQUENTIAL); + return 0; +} +], +[AC_MSG_RESULT(yes)] +[AC_DEFINE(HAVE_POSIX_FADVISE)], +AC_MSG_RESULT(no)) AC_FUNC_SNPRINTF if test "x$ac_cv_have_working_snprintf" = xyes; then @@ -386,13 +424,13 @@ if test "$enable_sql" = yes; then sql_servers="" if test "$found_mysql" = yes; then - sql_servers+="MySQL " + sql_servers="MySQL " fi if test "$found_postgresql" = yes; then - sql_servers+="Postgres " + sql_servers="${sql_servers} Postgres " fi if test "$found_sqlite" = yes; then - sql_servers+="Sqlite3 " + sql_servers="${sql_servers} Sqlite3 " fi echo "* SQL support: ${sql_servers:-No}" else Index: hdrs/version.h =================================================================== --- hdrs/version.h (.../p8) (revision 1426) +++ hdrs/version.h (.../p9) (revision 1426) @@ -1,4 +1,4 @@ #define VERSION "1.8.3" -#define PATCHLEVEL "7" -#define PATCHDATE "[10/01/2008]" -#define NUMVERSION 1008003007 +#define PATCHLEVEL "9" +#define PATCHDATE "[02/28/2008]" +#define NUMVERSION 1008003009 Index: aclocal.m4 =================================================================== --- aclocal.m4 (.../p8) (revision 1426) +++ aclocal.m4 (.../p9) (revision 1426) @@ -707,13 +707,12 @@ saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $ac_sqlite3_cppflags" - AC_LANG_PUSH(C++) AC_COMPILE_IFELSE( [ AC_LANG_PROGRAM([[@%:@include ]], [[ #if (SQLITE_VERSION_NUMBER >= $sqlite3_version_req_number) -// Everything is okay +/* Everything is okay */ #else # error SQLite version is too old #endif @@ -729,7 +728,6 @@ succees="no" ] ) - AC_LANG_POP([C++]) CPPFLAGS="$saved_CPPFLAGS"