Compare commits

...

10 commits

Author SHA1 Message Date
John "Elwin" Edwards
35c5e434e6 Rearrange some Autoconf files.
Autoconf was failing to detect install-sh at the top level and needed
some explicit directions.  It also wants config.guess and config.sub to
be provided too.

A few other macros have also been updated.
2023-09-05 20:05:24 -04:00
John "Elwin" Edwards
8a4bf37667 Naming items should not use up a turn.
This was fixed by adding "after = FALSE;" to the relevant cases in
command().

Rogue V4 and V5 are not affected.
2021-10-31 21:35:53 -04:00
John "Elwin" Edwards
2a9d279baa Advanced Rogue 5, 7: fix some trading post messages.
When attempting to buy an unaffordable object, messages were often of
the form "You can't afford that a scroll of hold monster !", because
the object description (stored in curpurch) was the same text used in
inventory displays.

This has been worked around by inspecting the contents of curpurch and
using different message templates.
2021-10-24 20:26:21 -04:00
John "Elwin" Edwards
b6067e102e Advanced Rogue 7: fix a crash when casting magic missile.
do_zap() dereferenced a struct object pointer while ignoring the result
of a NULL check.  XRogue had the same problem, though triggering it was
unlikely, since XRogue does not include a magic missile spell.

Reported by John Harris of @Play.
2021-10-21 21:00:15 -04:00
John "Elwin" Edwards
fb0ef69143 Advanced Rogue 7: fix a string literal overwrite.
pick_spell() attempted to capitalize type by overwriting the first
character, changing it back later.  All calls of pick_spell passed a
string literal as type, and string literals should be considered
immutable.

This has been fixed by using a separate variable for the capitalized
first character.  XRogue already has a similar fix.

Reported by John Harris of @Play.
2021-10-19 20:39:00 -04:00
John "Elwin" Edwards
6a654fbe69 Update the Autoconf files.
These are mostly automatic updates for obsolete macros.
2021-05-11 22:30:03 -04:00
John "Elwin" Edwards
06cad9ee1e Fix one more batch of compiler warnings.
A few of these were potential bugs.
2021-05-04 21:03:47 -04:00
John "Elwin" Edwards
3dfd8fd09b Advanced Rogue family: fix some potential buffer overflows.
Some code for determining the score file location assumed that PATH_MAX
would be less than 1024, which cannot be guaranteed.

Advanced Rogue 5 and 7, and XRogue, have had the buffers for the file
name enlarged.  UltraRogue never called the functions, so the code has
been deleted instead.
2021-05-03 19:05:37 -04:00
John "Elwin" Edwards
2b6d8bcb77 Advanced Rogue 7: ignore file locations in the save file when restoring.
The variables file_name, score_file, and home are no longer overwritten
with the values stored in the save file.  Those values could be
inaccurate if the files have been moved or configuration has changed.
2021-05-02 21:54:11 -04:00
John "Elwin" Edwards
d1422feb80 Fix a few more miscellaneous compiler warnings. 2021-05-01 09:51:30 -04:00
69 changed files with 4058 additions and 521 deletions

View file

@ -6,14 +6,10 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working curses], mp_cv_curses,
[LIBS="$LIBS -lcurses"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_curses=yes, mp_cv_curses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_curses=yes],[mp_cv_curses=no])])
if test "$mp_cv_curses" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
#AC_DEFINE(HAVE_CURSES_H)
CURSES_LIB="-lcurses"
fi
fi
@ -21,10 +17,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses,
[LIBS="$mp_save_LIBS -lncurses"
AC_TRY_LINK(
[#include <ncurses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_ncurses=yes, mp_cv_ncurses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ncurses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_ncurses=yes],[mp_cv_ncurses=no])])
if test "$mp_cv_ncurses" = yes
then
AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested])
@ -35,10 +28,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses,
[LIBS="$mp_save_LIBS -lpdcurses"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcurses=yes, mp_cv_pdcurses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcurses=yes],[mp_cv_pdcurses=no])])
if test "$mp_cv_pdcurses" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -49,10 +39,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur,
[LIBS="$mp_save_LIBS -lpdcur"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcur=yes, mp_cv_pdcur=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcur=yes],[mp_cv_pdcur=no])])
if test "$mp_cv_pdcur" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -63,10 +50,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses,
[LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a"
AC_TRY_LINK(
[#include "../pdcurses/curses.h"],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_lpdcurses=yes, mp_cv_lpdcurses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "../pdcurses/curses.h"]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_lpdcurses=yes],[mp_cv_lpdcurses=no])])
if test "$mp_cv_lpdcurses" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -76,12 +60,10 @@ AC_DEFUN([MP_WITH_CURSES],
fi
AC_CACHE_CHECK([for ESCDELAY variable],
[mc_cv_ncurses_escdelay],
[AC_TRY_LINK([], [
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
extern int ESCDELAY;
ESCDELAY = 0;
],
[mc_cv_ncurses_escdelay=yes],
[mc_cv_ncurses_escdelay=no])
]])],[mc_cv_ncurses_escdelay=yes],[mc_cv_ncurses_escdelay=no])
])
if test "$mc_cv_ncurses_escdelay" = yes; then
AC_DEFINE(HAVE_ESCDELAY, 1,

View file

@ -222,8 +222,8 @@ command(void)
when 'W' : wear();
when 'T' : take_off();
when 'o' : option();
when 'c' : call(FALSE);
when 'm' : call(TRUE);
when 'c' : after = FALSE; call(FALSE);
when 'm' : after = FALSE; call(TRUE);
when '>' : after = FALSE; d_level();
when '<' : after = FALSE; u_level();
when '?' : after = FALSE; help();

View file

@ -1,18 +1,17 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT([ARogue],[5.8.2], [yendor@rogueforge.net], [arogue5])
AC_PREREQ([2.69])
AC_INIT([Advanced Rogue],[5.8.2],[elwin@sdf.org],[arogue5])
AC_CONFIG_HEADERS([config.h])
# May not be needed for the documentation
AC_CONFIG_FILES([Makefile])
AC_CONFIG_AUX_DIR([../build-aux])
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
MP_WITH_CURSES
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([pwd.h errno.h fcntl.h limits.h nlist.h stdlib.h string.h sys/ioctl.h sys/utsname.h termios.h unistd.h utmp.h term.h ncurses/term.h process.h arpa/inet.h])
# Checks for typedefs, structures, and compiler characteristics.
@ -23,17 +22,16 @@ AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL
AC_FUNC_LSTAT
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr nlist _spawnl spawnl getpwuid loadav getloadavg strerror setgid setuid getuid getgid])
AC_PROG_INSTALL
AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="arogue5"] )
AC_ARG_WITH(program-name, AS_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="arogue5"] )
PROGRAM=$progname
AC_SUBST(PROGRAM)
AC_ARG_ENABLE(setgid, AC_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
AC_ARG_ENABLE(setgid, AS_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
AC_MSG_CHECKING([if using setgid execute bit])
if test "x$enable_setgid" = "xno" ; then
GROUPOWNER=
@ -54,7 +52,7 @@ fi
AC_SUBST(GROUPOWNER)
AC_ARG_ENABLE([scorefile],[AC_HELP_STRING([--enable-scorefile=SCOREFILE], [enable scoreboard with given filename])],[],[])
AC_ARG_ENABLE([scorefile],[AS_HELP_STRING([--enable-scorefile=SCOREFILE],[enable scoreboard with given filename])],[],[])
AC_MSG_CHECKING([for scoreboard file])
if test "x$enable_scorefile" = "xno" ; then
SCOREFILE=
@ -75,7 +73,7 @@ fi
AC_SUBST(SCOREFILE)
AC_ARG_ENABLE([logfile],[AC_HELP_STRING([--enable-logfile=LOGFILE], [enable logfile with given filename])],[],[])
AC_ARG_ENABLE([logfile],[AS_HELP_STRING([--enable-logfile=LOGFILE],[enable logfile with given filename])],[],[])
AC_MSG_CHECKING([for log file])
if test "x$enable_logfile" = "xno" ; then
LOGFILE=
@ -96,7 +94,7 @@ fi
AC_SUBST(LOGFILE)
AC_ARG_ENABLE([savedir],[AC_HELP_STRING([--enable-savedir=SAVEDIR], [enable systemwide location for saved games])],[],[enable_savedir="no"])
AC_ARG_ENABLE([savedir],[AS_HELP_STRING([--enable-savedir=SAVEDIR],[enable systemwide location for saved games])],[],[enable_savedir="no"])
AC_MSG_CHECKING([for save directory])
if test "x$enable_savedir" = "xno" ; then
SAVEDIR=
@ -119,7 +117,7 @@ fi
AC_SUBST(SAVEDIR)
AC_ARG_ENABLE([wizardmode],[AC_HELP_STRING([--enable-wizardmode], [enable availability of wizard mode @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([wizardmode],[AS_HELP_STRING([--enable-wizardmode],[enable availability of wizard mode @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if wizard mode is enabled])
if test "x$enable_wizardmode" = "xno" ; then
AC_MSG_RESULT([no])
@ -130,7 +128,7 @@ AC_DEFINE([WIZARD], [], [Define to include wizard mode])
AC_MSG_RESULT([yes])
fi
AC_ARG_ENABLE([limitscore],[AC_HELP_STRING([--enable-limitscore], [limit scores to one per class per uid @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([limitscore],[AS_HELP_STRING([--enable-limitscore],[limit scores to one per class per uid @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if limiting scores])
if test "x$enable_limitscore" = "xno" ; then
AC_MSG_RESULT([no])
@ -141,7 +139,7 @@ AC_DEFINE([LIMITSCORE], [], [Define to limit scores to one per class per uid])
AC_MSG_RESULT([yes])
fi
AC_ARG_ENABLE([maxload],[AC_HELP_STRING([--enable-maxload], [enable maxload @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([maxload],[AS_HELP_STRING([--enable-maxload],[enable maxload @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([runtime execution limit (maximum system load average)])
if test "x$enable_maxload" = "xyes" ; then
AC_DEFINE([MAXLOAD], [100], [Define if maxload feature should be enabled])
@ -155,7 +153,7 @@ AC_DEFINE_UNQUOTED([MAXLOAD], [$enable_maxload], [Define if maxload feature shou
AC_MSG_RESULT([$enable_maxload])
fi
AC_ARG_ENABLE([maxusers],[AC_HELP_STRING([--enable-maxusers], [enable maxuser @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([maxusers],[AS_HELP_STRING([--enable-maxusers],[enable maxuser @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([runtime execution limit (maximum online system users)])
if test "x$enable_maxusers" = "xyes" ; then
AC_DEFINE([MAXUSERS], [100], [Define if maxusers feature should be enabled])

View file

@ -61,6 +61,7 @@ main(int argc, char *argv[], char *envp[])
* get home and options from environment
*/
strncpy(home,md_gethomedir(),LINELEN);
home[LINELEN-1] = '\0';
#ifdef SAVEDIR
if (argc >= 3 && !strcmp(argv[1], "-n")) {
@ -82,8 +83,8 @@ main(int argc, char *argv[], char *envp[])
}
#ifdef SCOREFILE
strncpy(score_file, SCOREFILE, LINELEN);
score_file[LINELEN - 1] = '\0';
strncpy(score_file, SCOREFILE, PATH_MAX);
score_file[PATH_MAX - 1] = '\0';
#else
/* Get default score file */
strcpy(score_file, roguedir);

View file

@ -418,7 +418,7 @@ directory_exists(char *dirname)
char *
md_getroguedir(void)
{
static char path[1024];
static char path[PATH_MAX-20];
char *end,*home;
if ( (home = getenv("ROGUEHOME")) != NULL)
@ -427,13 +427,17 @@ md_getroguedir(void)
{
strncpy(path, home, PATH_MAX - 20);
end = &path[strlen(path)-1];
if (path[PATH_MAX-21] == '\0')
{
while( (end >= path) && ((*end == '/') || (*end == '\\')))
*end-- = '\0';
end = &path[strlen(path)-1];
if (directory_exists(path))
return(path);
while( (end >= path) && ((*end == '/') || (*end == '\\')))
*end-- = '\0';
if (directory_exists(path))
return(path);
}
}
}

View file

@ -770,12 +770,12 @@ wake_monster(int y, int x)
/*
* Every time he sees mean monster, it might start chasing him
*/
if (on(*tp, ISMEAN) &&
if ((on(*tp, ISMEAN) &&
off(*tp, ISHELD) &&
off(*tp, ISRUN) &&
rnd(100) > 33 &&
(!is_stealth(&player) || (on(*tp, ISUNIQUE) && rnd(100) > 95)) &&
(off(player, ISINVIS) || on(*tp, CANSEE)) ||
(off(player, ISINVIS) || on(*tp, CANSEE))) ||
(trp != NULL && (trp->r_flags & ISTREAS))) {
tp->t_dest = &hero;
turn_on(*tp, ISRUN);

View file

@ -17,6 +17,7 @@
#include "curses.h"
#include <ctype.h>
#include <string.h>
#include <limits.h>
#include "rogue.h"
#define NUM_OPTS (sizeof optlist / sizeof (OPTION))
@ -91,7 +92,7 @@ int get_restr(char *optstr, WINDOW *win)
/* For the score file, which must be opened. */
int get_score(char *optstr, WINDOW *win)
{
char old_score_file[LINELEN];
char old_score_file[PATH_MAX];
int status;
if (use_savedir)

View file

@ -13,6 +13,7 @@
*/
#include <ctype.h>
#include <limits.h>
#include "curses.h"
#include "rogue.h"
@ -85,7 +86,7 @@ char *ws_guess[MAXSTICKS]; /* Players guess at what wand is */
char *m_guess[MAXMM]; /* Players guess at what MM is */
char *ws_type[MAXSTICKS]; /* Is it a wand or a staff */
char file_name[256]; /* Save file name */
char score_file[LINELEN]; /* Score file name */
char score_file[PATH_MAX]; /* Score file name */
char home[LINELEN]; /* User's home directory */
WINDOW *cw; /* Window that the player sees */
WINDOW *hw; /* Used for the help command */

View file

@ -1046,7 +1046,7 @@ void init_player(void);
void init_stones(void);
void init_terrain(void);
void init_things(void);
void init_weapon(struct object *weap, char type);
void init_weapon(struct object *weap, int type);
char *inv_name(struct object *obj, bool drop);
bool inventory(struct linked_list *list, int type);
bool is_current(struct object *obj);

View file

@ -51,7 +51,16 @@ buy_it(void)
}
mpos = 0;
if (curprice > purse) {
msg("You can't afford to buy that %s !",curpurch);
if (!strncmp(curpurch, "a ", 2))
msg("You can't afford to buy that %s!", curpurch + 2);
else if (!strncmp(curpurch, "an ", 3))
msg("You can't afford to buy that %s!", curpurch + 3);
else if (!strncmp(curpurch, "some ", 5))
msg("You can't afford to buy that %s!", curpurch + 5);
else if (isdigit(curpurch[0]))
msg("You can't afford to buy those %s!", curpurch);
else
msg("You can't afford to buy that %s!", curpurch);
return;
}
/*

View file

@ -140,7 +140,7 @@ hit_monster(int y, int x, struct object *obj, struct thing *tp)
*/
void
init_weapon(struct object *weap, char type)
init_weapon(struct object *weap, int type)
{
register struct init_weps *iwp;

View file

@ -6,14 +6,10 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working curses], mp_cv_curses,
[LIBS="$LIBS -lcurses"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_curses=yes, mp_cv_curses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_curses=yes],[mp_cv_curses=no])])
if test "$mp_cv_curses" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
#AC_DEFINE(HAVE_CURSES_H)
CURSES_LIB="-lcurses"
fi
fi
@ -21,10 +17,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses,
[LIBS="$mp_save_LIBS -lncurses"
AC_TRY_LINK(
[#include <ncurses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_ncurses=yes, mp_cv_ncurses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ncurses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_ncurses=yes],[mp_cv_ncurses=no])])
if test "$mp_cv_ncurses" = yes
then
AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested])
@ -35,10 +28,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses,
[LIBS="$mp_save_LIBS -lpdcurses"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcurses=yes, mp_cv_pdcurses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcurses=yes],[mp_cv_pdcurses=no])])
if test "$mp_cv_pdcurses" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -49,10 +39,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur,
[LIBS="$mp_save_LIBS -lpdcur"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcur=yes, mp_cv_pdcur=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcur=yes],[mp_cv_pdcur=no])])
if test "$mp_cv_pdcur" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -63,10 +50,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses,
[LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a"
AC_TRY_LINK(
[#include "../pdcurses/curses.h"],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_lpdcurses=yes, mp_cv_lpdcurses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "../pdcurses/curses.h"]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_lpdcurses=yes],[mp_cv_lpdcurses=no])])
if test "$mp_cv_lpdcurses" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -76,12 +60,10 @@ AC_DEFUN([MP_WITH_CURSES],
fi
AC_CACHE_CHECK([for ESCDELAY variable],
[mc_cv_ncurses_escdelay],
[AC_TRY_LINK([], [
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
extern int ESCDELAY;
ESCDELAY = 0;
],
[mc_cv_ncurses_escdelay=yes],
[mc_cv_ncurses_escdelay=no])
]])],[mc_cv_ncurses_escdelay=yes],[mc_cv_ncurses_escdelay=no])
])
if test "$mc_cv_ncurses_escdelay" = yes; then
AC_DEFINE(HAVE_ESCDELAY, 1,

View file

@ -285,9 +285,9 @@ command(void)
when C_WEAR : wear();
when C_TAKEOFF : take_off();
when 'o' : option();
when CTRL('N') : nameit();
when CTRL('N') : after = FALSE; nameit();
when '=' : after = FALSE; display();
when 'm' : nameitem(NULL, TRUE);
when 'm' : after = FALSE; nameitem(NULL, TRUE);
when '>' : after = FALSE; d_level();
when '<' : after = FALSE; u_level();
when '?' : after = FALSE; help();

View file

@ -1,17 +1,17 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT([ARogue],[7.7.1], [yendor@rogueforge.net], [arogue7])
AC_PREREQ([2.69])
AC_INIT([Advanced Rogue],[7.7.1],[elwin@sdf.org],[arogue7])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_AUX_DIR([../build-aux])
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
MP_WITH_CURSES
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([pwd.h errno.h fcntl.h limits.h stdlib.h string.h sys/ioctl.h sys/utsname.h termios.h unistd.h utmp.h term.h ncurses/term.h process.h arpa/inet.h])
# Checks for typedefs, structures, and compiler characteristics.
@ -21,7 +21,6 @@ AC_STRUCT_TM
AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr _spawnl spawnl getpwuid loadav strerror setgid setuid getuid getgid])
AC_PROG_INSTALL
@ -48,11 +47,11 @@ AC_SUBST(DOCS_GROFF)
AC_SUBST(DOCS_NROFF)
AC_SUBST(DOCS_NONE)
AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="arogue7"] )
AC_ARG_WITH(program-name, AS_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="arogue7"] )
PROGRAM=$progname
AC_SUBST(PROGRAM)
AC_ARG_ENABLE(setgid, AC_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
AC_ARG_ENABLE(setgid, AS_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
AC_MSG_CHECKING([if using setgid execute bit])
if test "x$enable_setgid" = "xno" ; then
GROUPOWNER=
@ -73,7 +72,7 @@ fi
AC_SUBST(GROUPOWNER)
AC_ARG_ENABLE([scorefile],[AC_HELP_STRING([--enable-scorefile=SCOREFILE], [enable scoreboard with given filename])],[],[])
AC_ARG_ENABLE([scorefile],[AS_HELP_STRING([--enable-scorefile=SCOREFILE],[enable scoreboard with given filename])],[],[])
AC_MSG_CHECKING([for scoreboard file])
if test "x$enable_scorefile" = "xno" ; then
SCOREFILE=
@ -94,7 +93,7 @@ fi
AC_SUBST(SCOREFILE)
AC_ARG_ENABLE([logfile],[AC_HELP_STRING([--enable-logfile=LOGFILE], [enable logfile with given filename])],[],[])
AC_ARG_ENABLE([logfile],[AS_HELP_STRING([--enable-logfile=LOGFILE],[enable logfile with given filename])],[],[])
AC_MSG_CHECKING([for log file])
if test "x$enable_logfile" = "xno" ; then
LOGFILE=
@ -115,7 +114,7 @@ fi
AC_SUBST(LOGFILE)
AC_ARG_ENABLE([savedir],[AC_HELP_STRING([--enable-savedir=SAVEDIR], [enable systemwide location for saved games])],[],[enable_savedir="no"])
AC_ARG_ENABLE([savedir],[AS_HELP_STRING([--enable-savedir=SAVEDIR],[enable systemwide location for saved games])],[],[enable_savedir="no"])
AC_MSG_CHECKING([for save directory])
if test "x$enable_savedir" = "xno" ; then
SAVEDIR=
@ -138,7 +137,7 @@ fi
AC_SUBST(SAVEDIR)
AC_ARG_ENABLE([wizardmode],[AC_HELP_STRING([--enable-wizardmode], [enable availability of wizard mode @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([wizardmode],[AS_HELP_STRING([--enable-wizardmode],[enable availability of wizard mode @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if wizard mode is enabled])
if test "x$enable_wizardmode" = "xno" ; then
AC_MSG_RESULT([no])
@ -149,7 +148,7 @@ AC_DEFINE([WIZARD], [], [Define to include wizard mode])
AC_MSG_RESULT([yes])
fi
AC_ARG_ENABLE([limitscore],[AC_HELP_STRING([--enable-limitscore], [limit scores to one per class per uid @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([limitscore],[AS_HELP_STRING([--enable-limitscore],[limit scores to one per class per uid @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if limiting scores])
if test "x$enable_limitscore" = "xno" ; then
AC_MSG_RESULT([no])
@ -160,7 +159,7 @@ AC_DEFINE([LIMITSCORE], [], [Define to limit scores to one per class per uid])
AC_MSG_RESULT([yes])
fi
AC_ARG_ENABLE([maxusers],[AC_HELP_STRING([--enable-maxusers], [enable maxuser @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([maxusers],[AS_HELP_STRING([--enable-maxusers],[enable maxuser @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([runtime execution limit (maximum online system users)])
if test "x$enable_maxusers" = "xyes" ; then
AC_DEFINE([MAXUSERS], [100], [Define if maxusers feature should be enabled])

View file

@ -16,6 +16,7 @@
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <limits.h>
#include <errno.h>
#ifdef BSD
#include <sys/time.h>
@ -59,6 +60,7 @@ main(int argc, char *argv[], char *envp[])
*/
strncpy(home, md_gethomedir(), LINELEN);
home[LINELEN-1] = '\0';
/* Get default save file */
strcpy(file_name, home);
@ -66,8 +68,8 @@ main(int argc, char *argv[], char *envp[])
/* Get default score file */
#ifdef SCOREFILE
strncpy(score_file, SCOREFILE, LINELEN);
score_file[LINELEN-1] = '\0';
strncpy(score_file, SCOREFILE, PATH_MAX);
score_file[PATH_MAX-1] = '\0';
#else
strcpy(score_file, md_getroguedir());

View file

@ -421,7 +421,7 @@ directory_exists(char *dirname)
char *
md_getroguedir(void)
{
static char path[1024];
static char path[PATH_MAX-20];
char *end,*home;
if ( (home = getenv("ROGUEHOME")) != NULL)
@ -430,13 +430,16 @@ md_getroguedir(void)
{
strncpy(path, home, PATH_MAX - 20);
end = &path[strlen(path)-1];
if (path[PATH_MAX-21] == '\0')
{
end = &path[strlen(path)-1];
while( (end >= path) && ((*end == '/') || (*end == '\\')))
*end-- = '\0';
while( (end >= path) && ((*end == '/') || (*end == '\\')))
*end-- = '\0';
if (directory_exists(path))
return(path);
if (directory_exists(path))
return(path);
}
}
}

View file

@ -594,12 +594,12 @@ wake_monster(int y, int x)
/*
* Every time he sees mean monster, it might start chasing him
*/
if (on(*tp, ISMEAN) &&
if ((on(*tp, ISMEAN) &&
off(*tp, ISHELD) &&
off(*tp, ISRUN) &&
rnd(100) > 33 &&
(!is_stealth(&player) || (on(*tp, ISUNIQUE) && rnd(100) > 50)) &&
(off(player, ISINVIS) || on(*tp, CANSEE)) ||
(off(player, ISINVIS) || on(*tp, CANSEE))) ||
(trp != NULL && (trp->r_flags & ISTREAS))) {
runto(tp, &hero);
}

View file

@ -132,7 +132,8 @@ be_trapped(struct thing *th, coord *tc)
/* Make sure we were not chasing a monster here */
th->t_dest = &hero;
if (on(*th, ISFRIENDLY), turn_off(*th, ISFLEE));
if (on(*th, ISFRIENDLY))
turn_off(*th, ISFLEE);
}
}
when BEARTRAP:
@ -406,7 +407,8 @@ be_trapped(struct thing *th, coord *tc)
/* Make sure we were not chasing a monster here */
th->t_dest = &hero;
if (on(*th, ISFRIENDLY), turn_off(*th, ISFLEE));
if (on(*th, ISFRIENDLY))
turn_off(*th, ISFLEE);
}
else
killed(mitem, FALSE, FALSE, FALSE);

View file

@ -21,6 +21,7 @@
#include "curses.h"
#include <ctype.h>
#include <limits.h>
#include <string.h>
#include "rogue.h"
@ -491,7 +492,7 @@ get_str_prot(char *opt, WINDOW *win)
int
get_score(char *optstr, WINDOW *win)
{
char old_score_file[LINELEN];
char old_score_file[PATH_MAX];
int status;
if (use_savedir)

View file

@ -216,7 +216,10 @@ conn(int r1, int r2)
offset = abs(spos.y - epos.y);
}
else
{
debug("error in connection tables");
return;
}
/*
* Draw in the doors on either side of the passage or just put #'s

View file

@ -681,12 +681,13 @@ pick_spell(struct spells spells[], int ability, int num_spells, int power,
}
else {
/* Now display the possible spells */
/* type_cap is a workaround for code that tried to capitalize type by
* temporarily modifying it in place. */
char type_cap = toupper(type[0]);
wclear(hw);
touchwin(hw);
wmove(hw, 2, 0);
*type = toupper(*type);
wprintw(hw, " Cost %s", type);
*type = tolower(*type);
wprintw(hw, " Cost %c%s", type_cap, type + 1);
mvwaddstr(hw, 3, 0,
"-----------------------------------------------");
maxlen = 47; /* Maximum width of header */
@ -733,9 +734,7 @@ pick_spell(struct spells spells[], int ability, int num_spells, int power,
/* Design prompts */
sprintf(label, "Current %s power is %d", type, spell_left);
*type = toupper(*type);
sprintf(title, " Cost %s", type);
*type = tolower(*type);
sprintf(title, " Cost %c%s", type_cap, type + 1);
sprintf(prbuf, "Select a %s or press Cancl to continue.", type);
/* Set up the main menu structure */

View file

@ -13,6 +13,7 @@
*/
#include <ctype.h>
#include <limits.h>
#include "curses.h"
#include "rogue.h"
#ifdef PC7300
@ -102,7 +103,7 @@ char *ws_guess[MAXSTICKS]; /* Players guess at what wand is */
char *m_guess[MAXMM]; /* Players guess at what MM is */
char *ws_type[MAXSTICKS]; /* Is it a wand or a staff */
char file_name[LINELEN]; /* Save file name */
char score_file[LINELEN]; /* Score file name */
char score_file[PATH_MAX]; /* Score file name */
char home[LINELEN]; /* User's home directory */
WINDOW *cw; /* Window that the player sees */
WINDOW *hw; /* Used for the help command */

View file

@ -1249,7 +1249,7 @@ void init_player(void);
void init_stones(void);
void init_terrain(void);
void init_things(void);
void init_weapon(struct object *weap, char type);
void init_weapon(struct object *weap, int type);
char *inv_name(struct object *obj, bool drop);
bool inventory(struct linked_list *list, int type);
bool is_current(struct object *obj);

View file

@ -2511,6 +2511,7 @@ int
rs_save_file(FILE *savef)
{
int i;
char temp_buf[LINELEN];
if (write_error)
return(WRITESTAT);
@ -2583,9 +2584,17 @@ rs_save_file(FILE *savef)
rs_write_misc(savef);
rs_write(savef,whoami,LINELEN);
rs_write(savef,huh,LINELEN);
rs_write(savef,file_name,LINELEN);
rs_write(savef,score_file,LINELEN);
rs_write(savef,home,LINELEN);
/* These path names are no longer used when restoring. They are only
* written here for compatibility. */
strncpy(temp_buf, file_name, LINELEN);
temp_buf[LINELEN-1] = '\0';
rs_write(savef, temp_buf, LINELEN);
strncpy(temp_buf, score_file, LINELEN);
temp_buf[LINELEN-1] = '\0';
rs_write(savef, temp_buf, LINELEN);
strncpy(temp_buf, home, LINELEN);
temp_buf[LINELEN-1] = '\0';
rs_write(savef, temp_buf, LINELEN);
rs_write_window(savef, cw);
rs_write_window(savef, hw);
rs_write_window(savef, mw);
@ -2638,6 +2647,7 @@ int
rs_restore_file(FILE *inf)
{
int i;
char unused_buf[LINELEN];
if (read_error || format_error)
return(READSTAT);
@ -2715,9 +2725,10 @@ rs_restore_file(FILE *inf)
rs_read_misc(inf);
rs_read(inf,whoami,LINELEN);
rs_read(inf,huh,LINELEN);
rs_read(inf,file_name,LINELEN);
rs_read(inf,score_file,LINELEN);
rs_read(inf,home,LINELEN);
/* These three path names are now ignored. */
rs_read(inf, unused_buf, LINELEN); /* file_name */
rs_read(inf, unused_buf, LINELEN); /* score_file */
rs_read(inf, unused_buf, LINELEN); /* home */
rs_read_window(inf, cw);
rs_read_window(inf, hw);
rs_read_window(inf, mw);

View file

@ -309,7 +309,7 @@ do_zap(struct thing *zapper, struct object *obj, coord *direction, int which,
if (!obj)
dice = zapper->t_stats.s_lvl;
if (obj->o_type == RELIC)
else if (obj->o_type == RELIC)
dice = 15;
else if (EQUAL(ws_type[which], "staff"))
dice = 10;

View file

@ -55,7 +55,14 @@ buy_it(void)
}
mpos = 0;
if (curprice > purse) {
msg("You can't afford to buy that %s !",curpurch);
if (!strncmp(curpurch, "a ", 2))
msg("You can't afford to buy that %s!", curpurch + 2);
else if (!strncmp(curpurch, "an ", 3))
msg("You can't afford to buy that %s!", curpurch + 3);
else if (isdigit(curpurch[0]))
msg("You can't afford to buy those %s!", curpurch);
else
msg("You can't afford to buy that %s!", curpurch);
return;
}
/*

View file

@ -197,7 +197,7 @@ hit_monster(int y, int x, struct object *obj, struct thing *tp)
*/
void
init_weapon(struct object *weap, char type)
init_weapon(struct object *weap, int type)
{
register struct init_weps *iwp;

1768
build-aux/config.guess vendored Executable file

File diff suppressed because it is too large Load diff

1890
build-aux/config.sub vendored Executable file

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
#!/bin/sh
#!/usr/bin/sh
# install - install a program, script, or datafile
scriptversion=2013-12-25.23; # UTC
scriptversion=2020-11-14.01; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@ -69,6 +69,11 @@ posix_mkdir=
# Desired mode of installed file.
mode=0755
# Create dirs (including intermediate dirs) using mode 755.
# This is like GNU 'install' as of coreutils 8.32 (2020).
mkdir_umask=22
backupsuffix=
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
@ -99,18 +104,28 @@ Options:
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-C install only if different (preserve data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-p pass -p to $cpprog.
-s $stripprog installed files.
-S SUFFIX attempt to back up existing files, with suffix SUFFIX.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
By default, rm is invoked with -f; when overridden with RMPROG,
it's up to you to specify -f if you want it.
If -S is not specified, no backups are attempted.
Email bug reports to bug-automake@gnu.org.
Automake home page: https://www.gnu.org/software/automake/
"
while test $# -ne 0; do
@ -137,8 +152,13 @@ while test $# -ne 0; do
-o) chowncmd="$chownprog $2"
shift;;
-p) cpprog="$cpprog -p";;
-s) stripcmd=$stripprog;;
-S) backupsuffix="$2"
shift;;
-t)
is_target_a_directory=always
dst_arg=$2
@ -255,6 +275,10 @@ do
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
# Don't chown directories that already exist.
if test $dstdir_status = 0; then
chowncmd=""
fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
@ -271,15 +295,18 @@ do
fi
dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
# If destination is a directory, append the input filename.
if test -d "$dst"; then
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstbase=`basename "$src"`
case $dst in
*/) dst=$dst$dstbase;;
*) dst=$dst/$dstbase;;
esac
dstdir_status=0
else
dstdir=`dirname "$dst"`
@ -288,27 +315,16 @@ do
fi
fi
case $dstdir in
*/) dstdirslash=$dstdir;;
*) dstdirslash=$dstdir/;;
esac
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
@ -318,43 +334,49 @@ do
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
# The $RANDOM variable is not portable (e.g., dash). Use it
# here however when possible just to lower collision chance.
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
trap '
ret=$?
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
exit $ret
' 0
# Because "mkdir -p" follows existing symlinks and we likely work
# directly in world-writeable /tmp, make sure that the '$tmpdir'
# directory is successfully created first before we actually test
# 'mkdir -p'.
if (umask $mkdir_umask &&
$mkdirprog $mkdir_mode "$tmpdir" &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
test_tmpdir="$tmpdir/a"
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
fi
trap '' 0;;
esac
if
@ -365,7 +387,7 @@ do
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
@ -394,7 +416,7 @@ do
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
(umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
@ -427,14 +449,25 @@ do
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
dsttmp=${dstdirslash}_inst.$$_
rmtmp=${dstdirslash}_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
(umask $cp_umask &&
{ test -z "$stripcmd" || {
# Create $dsttmp read-write so that cp doesn't create it read-only,
# which would cause strip to fail.
if test -z "$doit"; then
: >"$dsttmp" # No need to fork-exec 'touch'.
else
$doit touch "$dsttmp"
fi
}
} &&
$doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
@ -460,6 +493,13 @@ do
then
rm -f "$dsttmp"
else
# If $backupsuffix is set, and the file being installed
# already exists, attempt a backup. Don't worry if it fails,
# e.g., if mv doesn't support -f.
if test -n "$backupsuffix" && test -f "$dst"; then
$doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
fi
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
@ -474,9 +514,9 @@ do
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
$doit $rmcmd "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
{ $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
@ -493,9 +533,9 @@ do
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

View file

@ -6,14 +6,10 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working curses], mp_cv_curses,
[LIBS="$LIBS -lcurses"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_curses=yes, mp_cv_curses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_curses=yes],[mp_cv_curses=no])])
if test "$mp_cv_curses" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
#AC_DEFINE(HAVE_CURSES_H)
CURSES_LIB="-lcurses"
fi
fi
@ -21,10 +17,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses,
[LIBS="$mp_save_LIBS -lncurses"
AC_TRY_LINK(
[#include <ncurses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_ncurses=yes, mp_cv_ncurses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ncurses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_ncurses=yes],[mp_cv_ncurses=no])])
if test "$mp_cv_ncurses" = yes
then
AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested])
@ -35,10 +28,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses,
[LIBS="$mp_save_LIBS -lpdcurses"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcurses=yes, mp_cv_pdcurses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcurses=yes],[mp_cv_pdcurses=no])])
if test "$mp_cv_pdcurses" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -49,10 +39,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur,
[LIBS="$mp_save_LIBS -lpdcur"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcur=yes, mp_cv_pdcur=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcur=yes],[mp_cv_pdcur=no])])
if test "$mp_cv_pdcur" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -63,10 +50,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses,
[LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a"
AC_TRY_LINK(
[#include "../pdcurses/curses.h"],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_lpdcurses=yes, mp_cv_lpdcurses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "../pdcurses/curses.h"]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_lpdcurses=yes],[mp_cv_lpdcurses=no])])
if test "$mp_cv_lpdcurses" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -76,12 +60,10 @@ AC_DEFUN([MP_WITH_CURSES],
fi
AC_CACHE_CHECK([for ESCDELAY variable],
[mc_cv_ncurses_escdelay],
[AC_TRY_LINK([], [
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
extern int ESCDELAY;
ESCDELAY = 0;
],
[mc_cv_ncurses_escdelay=yes],
[mc_cv_ncurses_escdelay=no])
]])],[mc_cv_ncurses_escdelay=yes],[mc_cv_ncurses_escdelay=no])
])
if test "$mc_cv_ncurses_escdelay" = yes; then
AC_DEFINE(HAVE_ESCDELAY, 1,

View file

@ -166,7 +166,7 @@ command()
when 'P' : ring_on();
when 'R' : ring_off();
when 'o' : option();
when 'c' : call();
when 'c' : after = FALSE; call();
when '>' : after = FALSE; d_level();
when '<' : after = FALSE; u_level();
when '?' : after = FALSE; help();

View file

@ -1,20 +1,18 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT([Rogue],[3.6.4], [yendor@rogueforge.net], [rogue3])
AC_PREREQ([2.69])
AC_INIT([Rogue],[3.6.4],[elwin@sdf.org],[rogue3])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile rogue.6 rogue.r])
AC_CONFIG_AUX_DIR([../build-aux])
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
MP_WITH_CURSES
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h pwd.h errno.h fcntl.h limits.h nlist.h stdlib.h string.h sys/ioctl.h termios.h unistd.h utmp.h utmpx.h term.h ncurses/term.h process.h])
# WARN: the sources often don't include the headers when needed. That is one
# reason why adding "-Wall" to CFLAGS produces 1246 lines of messages.
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UID_T
@ -25,7 +23,6 @@ AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL
AC_FUNC_LSTAT
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr nlist _spawnl spawnl getpwuid loadav getloadavg strerror setgid setuid getuid getgid])
@ -55,11 +52,11 @@ AC_SUBST(DOCS_GROFF)
AC_SUBST(DOCS_NROFF)
AC_SUBST(DOCS_NONE)
AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="rogue3"] )
AC_ARG_WITH(program-name, AS_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="rogue3"] )
PROGRAM=$progname
AC_SUBST(PROGRAM)
AC_ARG_ENABLE(setgid, AC_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
AC_ARG_ENABLE(setgid, AS_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
AC_MSG_CHECKING([if using setgid execute bit])
if test "x$enable_setgid" = "xno" ; then
GROUPOWNER=
@ -80,7 +77,7 @@ fi
AC_SUBST(GROUPOWNER)
AC_ARG_ENABLE([scorefile],[AC_HELP_STRING([--enable-scorefile=SCOREFILE], [enable scoreboard with given filename])],[],[])
AC_ARG_ENABLE([scorefile],[AS_HELP_STRING([--enable-scorefile=SCOREFILE],[enable scoreboard with given filename])],[],[])
AC_MSG_CHECKING([for scoreboard file])
if test "x$enable_scorefile" = "xno" ; then
SCOREFILE=
@ -101,7 +98,7 @@ fi
AC_SUBST(SCOREFILE)
AC_ARG_ENABLE([logfile],[AC_HELP_STRING([--enable-logfile=LOGFILE], [enable logfile with given filename])],[],[])
AC_ARG_ENABLE([logfile],[AS_HELP_STRING([--enable-logfile=LOGFILE],[enable logfile with given filename])],[],[])
AC_MSG_CHECKING([for log file])
if test "x$enable_logfile" = "xno" ; then
LOGFILE=
@ -122,7 +119,7 @@ fi
AC_SUBST(LOGFILE)
AC_ARG_ENABLE([savedir],[AC_HELP_STRING([--enable-savedir=SAVEDIR], [enable systemwide location for saved games])],[],[enable_savedir="no"])
AC_ARG_ENABLE([savedir],[AS_HELP_STRING([--enable-savedir=SAVEDIR],[enable systemwide location for saved games])],[],[enable_savedir="no"])
AC_MSG_CHECKING([for save directory])
if test "x$enable_savedir" = "xno" ; then
SAVEDIR=
@ -145,7 +142,7 @@ fi
AC_SUBST(SAVEDIR)
AC_ARG_ENABLE([wizardmode],[AC_HELP_STRING([--enable-wizardmode], [enable availability of wizard mode @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([wizardmode],[AS_HELP_STRING([--enable-wizardmode],[enable availability of wizard mode @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if wizard mode is enabled])
if test "x$enable_wizardmode" = "xno" ; then
AC_MSG_RESULT([no])
@ -156,7 +153,7 @@ AC_DEFINE([WIZARD], [], [Define to include wizard mode])
AC_MSG_RESULT([yes])
fi
AC_ARG_ENABLE([maxload],[AC_HELP_STRING([--enable-maxload], [enable maxload @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([maxload],[AS_HELP_STRING([--enable-maxload],[enable maxload @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([runtime execution limit (maximum system load average)])
if test "x$enable_maxload" = "xyes" ; then
AC_DEFINE([MAXLOAD], [100], [Define if maxload feature should be enabled])
@ -170,7 +167,7 @@ AC_DEFINE_UNQUOTED([MAXLOAD], [$enable_maxload], [Define if maxload feature shou
AC_MSG_RESULT([$enable_maxload])
fi
AC_ARG_ENABLE([maxusers],[AC_HELP_STRING([--enable-maxusers], [enable maxuser @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([maxusers],[AS_HELP_STRING([--enable-maxusers],[enable maxuser @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([runtime execution limit (maximum online system users)])
if test "x$enable_maxusers" = "xyes" ; then
AC_DEFINE([MAXUSERS], [100], [Define if maxusers feature should be enabled])

View file

@ -6,14 +6,10 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working curses], mp_cv_curses,
[LIBS="$LIBS -lcurses"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_curses=yes, mp_cv_curses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_curses=yes],[mp_cv_curses=no])])
if test "$mp_cv_curses" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
#AC_DEFINE(HAVE_CURSES_H)
CURSES_LIB="-lcurses"
fi
fi
@ -21,10 +17,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses,
[LIBS="$mp_save_LIBS -lncurses"
AC_TRY_LINK(
[#include <ncurses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_ncurses=yes, mp_cv_ncurses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ncurses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_ncurses=yes],[mp_cv_ncurses=no])])
if test "$mp_cv_ncurses" = yes
then
AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested])
@ -35,10 +28,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses,
[LIBS="$mp_save_LIBS -lpdcurses"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcurses=yes, mp_cv_pdcurses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcurses=yes],[mp_cv_pdcurses=no])])
if test "$mp_cv_pdcurses" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -49,10 +39,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur,
[LIBS="$mp_save_LIBS -lpdcur"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcur=yes, mp_cv_pdcur=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcur=yes],[mp_cv_pdcur=no])])
if test "$mp_cv_pdcur" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -63,10 +50,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses,
[LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a"
AC_TRY_LINK(
[#include "../pdcurses/curses.h"],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_lpdcurses=yes, mp_cv_lpdcurses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "../pdcurses/curses.h"]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_lpdcurses=yes],[mp_cv_lpdcurses=no])])
if test "$mp_cv_lpdcurses" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -76,12 +60,10 @@ AC_DEFUN([MP_WITH_CURSES],
fi
AC_CACHE_CHECK([for ESCDELAY variable],
[mc_cv_ncurses_escdelay],
[AC_TRY_LINK([], [
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
extern int ESCDELAY;
ESCDELAY = 0;
],
[mc_cv_ncurses_escdelay=yes],
[mc_cv_ncurses_escdelay=no])
]])],[mc_cv_ncurses_escdelay=yes],[mc_cv_ncurses_escdelay=no])
])
if test "$mc_cv_ncurses_escdelay" = yes; then
AC_DEFINE(HAVE_ESCDELAY, 1,

View file

@ -1,18 +1,18 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT([Rogue],[5.2.2], [yendor@rogueforge.net], [rogue4])
AC_PREREQ([2.69])
AC_INIT([Rogue],[5.2.2],[elwin@sdf.org],[rogue4])
AC_CONFIG_SRCDIR([armor.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile rogue.6 rogue.me])
AC_CONFIG_AUX_DIR([../build-aux])
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
MP_WITH_CURSES
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h sys/utsname.h pwd.h fcntl.h limits.h nlist.h stdlib.h string.h sys/ioctl.h termios.h unistd.h utmpx.h term.h ncurses/term.h process.h])
# Checks for typedefs, structures, and compiler characteristics.
@ -24,7 +24,6 @@ AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL
AC_FUNC_LSTAT
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr nlist _spawnl spawnl getpwuid loadav getloadavg strerror setgid setuid getuid getgid])
@ -54,11 +53,11 @@ AC_SUBST(DOCS_GROFF)
AC_SUBST(DOCS_NROFF)
AC_SUBST(DOCS_NONE)
AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="rogue4"] )
AC_ARG_WITH(program-name, AS_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="rogue4"] )
PROGRAM=$progname
AC_SUBST(PROGRAM)
AC_ARG_ENABLE(setgid, AC_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
AC_ARG_ENABLE(setgid, AS_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
AC_MSG_CHECKING([if using setgid execute bit])
if test "x$enable_setgid" = "xno" ; then
GROUPOWNER=
@ -79,7 +78,7 @@ fi
AC_SUBST(GROUPOWNER)
AC_ARG_ENABLE([scorefile],[AC_HELP_STRING([--enable-scorefile=SCOREFILE], [enable scoreboard with given filename])],[],[])
AC_ARG_ENABLE([scorefile],[AS_HELP_STRING([--enable-scorefile=SCOREFILE],[enable scoreboard with given filename])],[],[])
AC_MSG_CHECKING([for scoreboard file])
if test "x$enable_scorefile" = "xno" ; then
SCOREFILE=
@ -100,7 +99,7 @@ fi
AC_SUBST(SCOREFILE)
AC_ARG_ENABLE([logfile],[AC_HELP_STRING([--enable-logfile=LOGFILE], [enable logfile with given filename])],[],[])
AC_ARG_ENABLE([logfile],[AS_HELP_STRING([--enable-logfile=LOGFILE],[enable logfile with given filename])],[],[])
AC_MSG_CHECKING([for log file])
if test "x$enable_logfile" = "xno" ; then
LOGFILE=
@ -121,7 +120,7 @@ fi
AC_SUBST(LOGFILE)
AC_ARG_ENABLE([lockfile],[AC_HELP_STRING([--enable-lockfile=LOCKFILE], [enable scoreboard lockfile with given filename])],[],[])
AC_ARG_ENABLE([lockfile],[AS_HELP_STRING([--enable-lockfile=LOCKFILE],[enable scoreboard lockfile with given filename])],[],[])
AC_MSG_CHECKING([for scoreboard lockfile file])
if test "x$enable_lockfile" = "xno" ; then
LOCKFILE=
@ -142,7 +141,7 @@ fi
AC_SUBST(LOCKFILE)
AC_ARG_ENABLE([savedir],[AC_HELP_STRING([--enable-savedir=SAVEDIR], [enable systemwide location for saved games])],[],[enable_savedir="no"])
AC_ARG_ENABLE([savedir],[AS_HELP_STRING([--enable-savedir=SAVEDIR],[enable systemwide location for saved games])],[],[enable_savedir="no"])
AC_MSG_CHECKING([for save directory])
if test "x$enable_savedir" = "xno" ; then
SAVEDIR=
@ -165,7 +164,7 @@ fi
AC_SUBST(SAVEDIR)
AC_ARG_ENABLE([wizardmode],[AC_HELP_STRING([--enable-wizardmode], [enable availability of wizard mode @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([wizardmode],[AS_HELP_STRING([--enable-wizardmode],[enable availability of wizard mode @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if wizard mode is enabled])
if test "x$enable_wizardmode" = "xno" ; then
AC_MSG_RESULT([no])
@ -179,7 +178,7 @@ fi
AC_MSG_RESULT([yes])
fi
AC_ARG_ENABLE([checktime],[AC_HELP_STRING([--enable-checktime], [enable checktime @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([checktime],[AS_HELP_STRING([--enable-checktime],[enable checktime @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if checktime is enabled])
if test "x$enable_checktime" = "xyes" ; then
AC_DEFINE([CHECKTIME], [1], [Define if checktime feature should be enabled])
@ -188,7 +187,7 @@ else
AC_MSG_RESULT([no])
fi
AC_ARG_ENABLE([maxload],[AC_HELP_STRING([--enable-maxload], [enable maxload @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([maxload],[AS_HELP_STRING([--enable-maxload],[enable maxload @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([runtime execution limit (maximum system load average)])
if test "x$enable_maxload" = "xyes" ; then
AC_DEFINE([MAXLOAD], [100], [Define if maxload feature should be enabled])
@ -202,7 +201,7 @@ AC_DEFINE_UNQUOTED([MAXLOAD], [$enable_maxload], [Define if maxload feature shou
AC_MSG_RESULT([$enable_maxload])
fi
AC_ARG_ENABLE([maxusers],[AC_HELP_STRING([--enable-maxusers], [enable maxuser @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([maxusers],[AS_HELP_STRING([--enable-maxusers],[enable maxuser @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([runtime execution limit (maximum online system users)])
if test "x$enable_maxusers" = "xyes" ; then
AC_DEFINE([MAXUSERS], [100], [Define if maxusers feature should be enabled])

View file

@ -6,14 +6,10 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working curses], mp_cv_curses,
[LIBS="$LIBS -lcurses"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_curses=yes, mp_cv_curses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_curses=yes],[mp_cv_curses=no])])
if test "$mp_cv_curses" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
#AC_DEFINE(HAVE_CURSES_H)
CURSES_LIB="-lcurses"
fi
fi
@ -21,10 +17,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses,
[LIBS="$mp_save_LIBS -lncurses"
AC_TRY_LINK(
[#include <ncurses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_ncurses=yes, mp_cv_ncurses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ncurses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_ncurses=yes],[mp_cv_ncurses=no])])
if test "$mp_cv_ncurses" = yes
then
AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested])
@ -35,10 +28,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses,
[LIBS="$mp_save_LIBS -lpdcurses"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcurses=yes, mp_cv_pdcurses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcurses=yes],[mp_cv_pdcurses=no])])
if test "$mp_cv_pdcurses" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -49,10 +39,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur,
[LIBS="$mp_save_LIBS -lpdcur"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcur=yes, mp_cv_pdcur=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcur=yes],[mp_cv_pdcur=no])])
if test "$mp_cv_pdcur" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -63,10 +50,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses,
[LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a"
AC_TRY_LINK(
[#include "../pdcurses/curses.h"],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_lpdcurses=yes, mp_cv_lpdcurses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "../pdcurses/curses.h"]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_lpdcurses=yes],[mp_cv_lpdcurses=no])])
if test "$mp_cv_lpdcurses" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -76,12 +60,10 @@ AC_DEFUN([MP_WITH_CURSES],
fi
AC_CACHE_CHECK([for ESCDELAY variable],
[mc_cv_ncurses_escdelay],
[AC_TRY_LINK([], [
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
extern int ESCDELAY;
ESCDELAY = 0;
],
[mc_cv_ncurses_escdelay=yes],
[mc_cv_ncurses_escdelay=no])
]])],[mc_cv_ncurses_escdelay=yes],[mc_cv_ncurses_escdelay=no])
])
if test "$mc_cv_ncurses_escdelay" = yes; then
AC_DEFINE(HAVE_ESCDELAY, 1,

View file

@ -1,11 +1,12 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT([Rogue],[5.4.5], [yendor@rogueforge.net], [rogue5])
AC_PREREQ([2.69])
AC_INIT([Rogue],[5.4.5],[elwin@sdf.org],[rogue5])
AC_CONFIG_SRCDIR([armor.c])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile rogue.6 rogue.me rogue.html])
AC_CONFIG_AUX_DIR([../build-aux])
# Checks for programs.
AC_PROG_CC
@ -14,7 +15,6 @@ AC_PROG_INSTALL
# Checks for libraries.
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h sys/utsname.h pwd.h fcntl.h limits.h nlist.h stdlib.h string.h sys/ioctl.h termios.h unistd.h utmp.h term.h ncurses/term.h process.h])
# Checks for typedefs, structures, and compiler characteristics.
@ -29,7 +29,6 @@ AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL
AC_FUNC_LSTAT
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr nlist _spawnl spawnl getpwuid loadav getloadavg strerror setresgid setregid setgid setresuid setreuid setuid getuid getgid])
@ -57,11 +56,11 @@ AC_SUBST(DOCS_GROFF)
AC_SUBST(DOCS_NROFF)
AC_SUBST(DOCS_NONE)
AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="rogue5"] )
AC_ARG_WITH(program-name, AS_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="rogue5"] )
PROGRAM=$progname
AC_SUBST(PROGRAM)
AC_ARG_ENABLE(setgid, AC_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
AC_ARG_ENABLE(setgid, AS_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
AC_MSG_CHECKING([if using setgid execute bit])
if test "x$enable_setgid" = "xno" ; then
GROUPOWNER=
@ -82,7 +81,7 @@ fi
AC_SUBST(GROUPOWNER)
AC_ARG_ENABLE([scorefile],[AC_HELP_STRING([--enable-scorefile=SCOREFILE], [enable scoreboard with given filename])],[],[])
AC_ARG_ENABLE([scorefile],[AS_HELP_STRING([--enable-scorefile=SCOREFILE],[enable scoreboard with given filename])],[],[])
AC_MSG_CHECKING([for scoreboard file])
if test "x$enable_scorefile" = "xno" ; then
SCOREFILE=
@ -103,7 +102,7 @@ fi
AC_SUBST(SCOREFILE)
AC_ARG_ENABLE([logfile],[AC_HELP_STRING([--enable-logfile=LOGFILE], [enable logfile with given filename])],[],[])
AC_ARG_ENABLE([logfile],[AS_HELP_STRING([--enable-logfile=LOGFILE],[enable logfile with given filename])],[],[])
AC_MSG_CHECKING([for log file])
if test "x$enable_logfile" = "xno" ; then
LOGFILE=
@ -124,7 +123,7 @@ fi
AC_SUBST(LOGFILE)
AC_ARG_ENABLE([lockfile],[AC_HELP_STRING([--enable-lockfile=LOCKFILE], [enable scoreboard lockfile with given filename])],[],[])
AC_ARG_ENABLE([lockfile],[AS_HELP_STRING([--enable-lockfile=LOCKFILE],[enable scoreboard lockfile with given filename])],[],[])
AC_MSG_CHECKING([for scoreboard lockfile file])
if test "x$enable_lockfile" = "xno" ; then
LOCKFILE=
@ -145,7 +144,7 @@ fi
AC_SUBST(LOCKFILE)
AC_ARG_ENABLE([savedir],[AC_HELP_STRING([--enable-savedir=SAVEDIR], [enable systemwide location for saved games])],[],[enable_savedir="no"])
AC_ARG_ENABLE([savedir],[AS_HELP_STRING([--enable-savedir=SAVEDIR],[enable systemwide location for saved games])],[],[enable_savedir="no"])
AC_MSG_CHECKING([for save directory])
if test "x$enable_savedir" = "xno" ; then
SAVEDIR=
@ -168,7 +167,7 @@ fi
AC_SUBST(SAVEDIR)
AC_ARG_ENABLE([wizardmode],[AC_HELP_STRING([--enable-wizardmode], [enable availability of wizard mode @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([wizardmode],[AS_HELP_STRING([--enable-wizardmode],[enable availability of wizard mode @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if wizard mode is enabled])
if test "x$enable_wizardmode" = "xno" ; then
AC_MSG_RESULT([no])
@ -182,7 +181,7 @@ fi
AC_MSG_RESULT([yes])
fi
AC_ARG_ENABLE([allscores],[AC_HELP_STRING([--enable-allscores], [enable scoreboard to show top scores, not just top players @<:@default=yes@:>@])],[],[enable_allscores=yes])
AC_ARG_ENABLE([allscores],[AS_HELP_STRING([--enable-allscores],[enable scoreboard to show top scores, not just top players @<:@default=yes@:>@])],[],[enable_allscores=yes])
AC_MSG_CHECKING([if allscores is enabled])
if test "x$enable_allscores" = "xyes" ; then
AC_DEFINE([ALLSCORES], [1], [Define if scorefile is top scores, not top players])
@ -191,7 +190,7 @@ else
AC_MSG_RESULT([no])
fi
AC_ARG_ENABLE([checktime],[AC_HELP_STRING([--enable-checktime], [enable checktime @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([checktime],[AS_HELP_STRING([--enable-checktime],[enable checktime @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if checktime is enabled])
if test "x$enable_checktime" = "xyes" ; then
AC_DEFINE([CHECKTIME], [1], [Define if checktime feature should be enabled])
@ -200,7 +199,7 @@ else
AC_MSG_RESULT([no])
fi
AC_ARG_ENABLE([maxload],[AC_HELP_STRING([--enable-maxload], [enable maxload @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([maxload],[AS_HELP_STRING([--enable-maxload],[enable maxload @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([runtime execution limit (maximum system load average)])
if test "x$enable_maxload" = "xyes" ; then
AC_DEFINE([MAXLOAD], [100], [Define if maxload feature should be enabled])
@ -214,7 +213,7 @@ AC_DEFINE_UNQUOTED([MAXLOAD], [$enable_maxload], [Define if maxload feature shou
AC_MSG_RESULT([$enable_maxload])
fi
AC_ARG_ENABLE([maxusers],[AC_HELP_STRING([--enable-maxusers], [enable maxuser @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([maxusers],[AS_HELP_STRING([--enable-maxusers],[enable maxuser @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([runtime execution limit (maximum online system users)])
if test "x$enable_maxusers" = "xyes" ; then
AC_DEFINE([MAXUSERS], [100], [Define if maxusers feature should be enabled])
@ -228,7 +227,7 @@ AC_DEFINE_UNQUOTED([MAXLOAD], [$enable_maxusers], [Define if maxusers feature sh
AC_MSG_RESULT([$enable_maxusers])
fi
AC_ARG_ENABLE([numscores],[AC_HELP_STRING([--enable-numscores], [number of scores to store in scoreboard @<:@default=10@:>@])],[],[])
AC_ARG_ENABLE([numscores],[AS_HELP_STRING([--enable-numscores],[number of scores to store in scoreboard @<:@default=10@:>@])],[],[])
AC_MSG_CHECKING([what the number of scores to store in scoreboard is])
if test "x$numscores" = "xyes" ; then
AC_DEFINE([NUMSCORES], [10], [number of scores to store in scoreboard])
@ -244,7 +243,7 @@ AC_DEFINE_UNQUOTED([NUMSCORES], [$enable_numscores], [number of scores to store
AC_MSG_RESULT([$enable_numscores])
fi
AC_ARG_ENABLE([numname],[AC_HELP_STRING([--enable-numname], [word for number of scores to store in scoreboard @<:@default=Ten@:>@])],[],[])
AC_ARG_ENABLE([numname],[AS_HELP_STRING([--enable-numname],[word for number of scores to store in scoreboard @<:@default=Ten@:>@])],[],[])
AC_MSG_CHECKING([word for the number of scores to store in scoreboard is])
if test "x$enable_numname" = "xyes" ; then
AC_DEFINE([NUMNAME], ["Ten"], [word for the number of scores to store in scoreboard])
@ -260,7 +259,7 @@ AC_DEFINE_UNQUOTED([NUMNAME], ["$enable_numname"], [word for the number of score
AC_MSG_RESULT([$enable_numname])
fi
AC_ARG_ENABLE([loadav],[AC_HELP_STRING([--enable-loadav=NAMELIST], [use program's load average function (unlikely to work) @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([loadav],[AS_HELP_STRING([--enable-loadav=NAMELIST],[use program's load average function (unlikely to work) @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([whether to use program's built in load average function])
if test "x$enable_loadav" = "xyes" ; then
AC_DEFINE([LOADAV], [], [define if we should use program's load average function instead of system])
@ -276,7 +275,7 @@ AC_DEFINE_UNQUOTED([NAMELIST], [$enable_loadav], [kernel file to pass to nlist()
AC_MSG_RESULT([$enable_loadav])
fi
AC_ARG_ENABLE([ucount],[AC_HELP_STRING([--enable-ucount=UTMPFILE], [use program's own function to count users (unlikely to work) @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([ucount],[AS_HELP_STRING([--enable-ucount=UTMPFILE],[use program's own function to count users (unlikely to work) @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([whether to use program's built in user counting function])
if test "x$enable_ucount" = "xyes" ; then
AC_DEFINE([UCOUNT], [], [define if we should use program's user counting function instead of system's])

View file

@ -6,14 +6,10 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working curses], mp_cv_curses,
[LIBS="$LIBS -lcurses"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_curses=yes, mp_cv_curses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_curses=yes],[mp_cv_curses=no])])
if test "$mp_cv_curses" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
#AC_DEFINE(HAVE_CURSES_H)
CURSES_LIB="-lcurses"
fi
fi
@ -21,10 +17,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses,
[LIBS="$mp_save_LIBS -lncurses"
AC_TRY_LINK(
[#include <ncurses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_ncurses=yes, mp_cv_ncurses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ncurses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_ncurses=yes],[mp_cv_ncurses=no])])
if test "$mp_cv_ncurses" = yes
then
AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested])
@ -35,10 +28,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses,
[LIBS="$mp_save_LIBS -lpdcurses"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcurses=yes, mp_cv_pdcurses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcurses=yes],[mp_cv_pdcurses=no])])
if test "$mp_cv_pdcurses" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -49,10 +39,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur,
[LIBS="$mp_save_LIBS -lpdcur"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcur=yes, mp_cv_pdcur=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcur=yes],[mp_cv_pdcur=no])])
if test "$mp_cv_pdcur" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -63,10 +50,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses,
[LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a"
AC_TRY_LINK(
[#include "../pdcurses/curses.h"],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_lpdcurses=yes, mp_cv_lpdcurses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "../pdcurses/curses.h"]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_lpdcurses=yes],[mp_cv_lpdcurses=no])])
if test "$mp_cv_lpdcurses" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -76,12 +60,10 @@ AC_DEFUN([MP_WITH_CURSES],
fi
AC_CACHE_CHECK([for ESCDELAY variable],
[mc_cv_ncurses_escdelay],
[AC_TRY_LINK([], [
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
extern int ESCDELAY;
ESCDELAY = 0;
],
[mc_cv_ncurses_escdelay=yes],
[mc_cv_ncurses_escdelay=no])
]])],[mc_cv_ncurses_escdelay=yes],[mc_cv_ncurses_escdelay=no])
])
if test "$mc_cv_ncurses_escdelay" = yes; then
AC_DEFINE(HAVE_ESCDELAY, 1,

View file

@ -175,7 +175,7 @@ command(void)
when 'P' : ring_on();
when 'R' : ring_off();
when 'O' : option();
when 'c' : call();
when 'c' : after = FALSE; call();
when '>' : after = FALSE; d_level();
when '<' : after = FALSE; u_level();
when '?' : after = FALSE; help();

View file

@ -1,17 +1,17 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT([SRogue],[9.0], [yendor@rogueforge.net], [srogue])
AC_PREREQ([2.69])
AC_INIT([Super-Rogue],[9.0],[elwin@sdf.org],[srogue])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_AUX_DIR([../build-aux])
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
MP_WITH_CURSES
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h pwd.h errno.h fcntl.h limits.h nlist.h stdlib.h string.h sys/ioctl.h termios.h unistd.h term.h ncurses/term.h process.h])
# Checks for typedefs, structures, and compiler characteristics.
@ -21,7 +21,6 @@ AC_STRUCT_TM
# Checks for library functions.
AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr nlist _spawnl spawnl getpwuid loadav getloadavg strerror setgid setuid getuid getgid lrand48 random srand48 srandom])
@ -50,11 +49,11 @@ AC_SUBST(DOCS_GROFF)
AC_SUBST(DOCS_NROFF)
AC_SUBST(DOCS_NONE)
AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="srogue"] )
AC_ARG_WITH(program-name, AS_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="srogue"] )
PROGRAM=$progname
AC_SUBST(PROGRAM)
AC_ARG_ENABLE(setgid, AC_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
AC_ARG_ENABLE(setgid, AS_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
AC_MSG_CHECKING([if using setgid execute bit])
if test "x$enable_setgid" = "xno" ; then
GROUPOWNER=
@ -75,7 +74,7 @@ fi
AC_SUBST(GROUPOWNER)
AC_ARG_ENABLE([scorefile],[AC_HELP_STRING([--enable-scorefile=SCOREFILE], [enable scoreboard with given filename])],[],[])
AC_ARG_ENABLE([scorefile],[AS_HELP_STRING([--enable-scorefile=SCOREFILE],[enable scoreboard with given filename])],[],[])
AC_MSG_CHECKING([for scoreboard file])
if test "x$enable_scorefile" = "xno" ; then
SCOREFILE=
@ -96,7 +95,7 @@ fi
AC_SUBST(SCOREFILE)
AC_ARG_ENABLE([logfile],[AC_HELP_STRING([--enable-logfile=LOGFILE], [enable logfile with given filename])],[],[])
AC_ARG_ENABLE([logfile],[AS_HELP_STRING([--enable-logfile=LOGFILE],[enable logfile with given filename])],[],[])
AC_MSG_CHECKING([for log file])
if test "x$enable_logfile" = "xno" ; then
LOGFILE=
@ -117,7 +116,7 @@ fi
AC_SUBST(LOGFILE)
AC_ARG_ENABLE([savedir],[AC_HELP_STRING([--enable-savedir=SAVEDIR], [enable systemwide location for saved games])],[],[enable_savedir="no"])
AC_ARG_ENABLE([savedir],[AS_HELP_STRING([--enable-savedir=SAVEDIR],[enable systemwide location for saved games])],[],[enable_savedir="no"])
AC_MSG_CHECKING([for save directory])
if test "x$enable_savedir" = "xno" ; then
SAVEDIR=
@ -140,7 +139,7 @@ fi
AC_SUBST(SAVEDIR)
AC_ARG_ENABLE([wizardmode],[AC_HELP_STRING([--enable-wizardmode], [enable availability of wizard mode @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([wizardmode],[AS_HELP_STRING([--enable-wizardmode],[enable availability of wizard mode @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if wizard mode is enabled])
if test "x$enable_wizardmode" = "xno" ; then
AC_MSG_RESULT([no])

View file

@ -24,7 +24,7 @@
* Pick a monster to show up. The lower the level,
* the meaner the monster.
*/
char
int
rnd_mon(bool wander, bool baddie)
{
/* baddie; TRUE when from a polymorph stick */
@ -85,7 +85,7 @@ lev_mon(void)
* Pick a new monster and add it to the list
*/
struct linked_list *
new_monster(char type, struct coord *cp, bool treas)
new_monster(int indx, struct coord *cp, bool treas)
{
reg struct linked_list *item;
reg struct thing *tp;
@ -97,9 +97,9 @@ new_monster(char type, struct coord *cp, bool treas)
attach(mlist, item);
tp = THINGPTR(item);
st = &tp->t_stats;
mp = &monsters[type]; /* point to this monsters structure */
mp = &monsters[indx]; /* point to this monsters structure */
tp->t_type = mp->m_show;
tp->t_indx = type;
tp->t_indx = indx;
tp->t_pos = *cp;
tp->t_room = roomin(cp);
tp->t_oldch = mvwinch(cw, cp->y, cp->x) & A_CHARTEXT;

View file

@ -199,6 +199,7 @@ conn(int r1, int r2)
}
else {
msg("Error in connection tables.");
return;
}
/*
* Draw in the doors on either side of the passage

View file

@ -154,7 +154,7 @@ void msg(char *fmt, ...);
char *new(int size);
struct linked_list *new_item(int size);
void new_level(int ltype);
struct linked_list *new_monster(char type, struct coord *cp, bool treas);
struct linked_list *new_monster(int indx, struct coord *cp, bool treas);
struct linked_list *new_thing(bool treas, int type, int which);
void nohaste(int fromfuse);
void noteth(int fromfuse);
@ -193,7 +193,7 @@ void ring_on(void);
void ringabil(void);
int ringex(int rtype);
int rnd(int range);
char rnd_mon(bool wander, bool baddie);
int rnd_mon(bool wander, bool baddie);
struct coord *rnd_pos(struct room *rp);
int rnd_room(void);
struct coord *rndmove(struct thing *who);

View file

@ -230,19 +230,20 @@ do_zap(bool gotdir)
tp = THINGPTR(item);
omonst = tp->t_indx;
if (wh == WS_POLYM && !curse) {
int newmonst;
detach(mlist, item);
discard(item);
oldch = tp->t_oldch;
delta.y = y;
delta.x = x;
monster = rnd_mon(FALSE, TRUE);
item = new_monster(monster, &delta, FALSE);
newmonst = rnd_mon(FALSE, TRUE);
item = new_monster(newmonst, &delta, FALSE);
if (!(tp->t_flags & ISRUN))
runto(&delta, &hero);
if (isalpha(mvwinch(cw, y, x)))
mvwaddch(cw, y, x, monsters[monster].m_show);
mvwaddch(cw, y, x, monsters[newmonst].m_show);
tp->t_oldch = oldch;
ws_know[WS_POLYM] |= (monster != omonst);
ws_know[WS_POLYM] |= (newmonst != omonst);
}
else if (wh == WS_MINVIS && !bless) {
tp->t_flags |= ISINVIS;

View file

@ -6,14 +6,10 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working curses], mp_cv_curses,
[LIBS="$LIBS -lcurses"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_curses=yes, mp_cv_curses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_curses=yes],[mp_cv_curses=no])])
if test "$mp_cv_curses" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
#AC_DEFINE(HAVE_CURSES_H)
CURSES_LIB="-lcurses"
fi
fi
@ -21,10 +17,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses,
[LIBS="$mp_save_LIBS -lncurses"
AC_TRY_LINK(
[#include <ncurses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_ncurses=yes, mp_cv_ncurses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ncurses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_ncurses=yes],[mp_cv_ncurses=no])])
if test "$mp_cv_ncurses" = yes
then
AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested])
@ -35,10 +28,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses,
[LIBS="$mp_save_LIBS -lpdcurses"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcurses=yes, mp_cv_pdcurses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcurses=yes],[mp_cv_pdcurses=no])])
if test "$mp_cv_pdcurses" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -49,10 +39,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur,
[LIBS="$mp_save_LIBS -lpdcur"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcur=yes, mp_cv_pdcur=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcur=yes],[mp_cv_pdcur=no])])
if test "$mp_cv_pdcur" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -63,10 +50,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses,
[LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a"
AC_TRY_LINK(
[#include "../pdcurses/curses.h"],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_lpdcurses=yes, mp_cv_lpdcurses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "../pdcurses/curses.h"]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_lpdcurses=yes],[mp_cv_lpdcurses=no])])
if test "$mp_cv_lpdcurses" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -76,12 +60,10 @@ AC_DEFUN([MP_WITH_CURSES],
fi
AC_CACHE_CHECK([for ESCDELAY variable],
[mc_cv_ncurses_escdelay],
[AC_TRY_LINK([], [
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
extern int ESCDELAY;
ESCDELAY = 0;
],
[mc_cv_ncurses_escdelay=yes],
[mc_cv_ncurses_escdelay=no])
]])],[mc_cv_ncurses_escdelay=yes],[mc_cv_ncurses_escdelay=no])
])
if test "$mc_cv_ncurses_escdelay" = yes; then
AC_DEFINE(HAVE_ESCDELAY, 1,

View file

@ -394,8 +394,8 @@ command(void)
case 'P': ring_on(); break;
case 'R': ring_off(); break;
case 'p': prayer(); break;
case 'C': call(FALSE); break;
case 'M': call(TRUE); break;
case 'C': after = FALSE; call(FALSE); break;
case 'M': after = FALSE; call(TRUE); break;
case 's': search(FALSE); break;
/*

View file

@ -1,17 +1,17 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT([UltraRogue],[1.07], [yendor@rogueforge.net], [urogue])
AC_PREREQ([2.69])
AC_INIT([UltraRogue],[1.07],[elwin@sdf.org],[urogue])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_AUX_DIR([../build-aux])
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
MP_WITH_CURSES
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([pwd.h errno.h fcntl.h limits.h nlist.h stdlib.h string.h sys/ioctl.h termios.h unistd.h utmp.h utmpx.h term.h ncurses/term.h process.h arpa/inet.h])
# Checks for typedefs, structures, and compiler characteristics.
@ -23,7 +23,6 @@ AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL
AC_FUNC_LSTAT
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr nlist _spawnl spawnl getpwuid loadav getloadavg strerror setgid setuid getuid getgid])
@ -52,11 +51,11 @@ AC_SUBST(DOCS_GROFF)
AC_SUBST(DOCS_NROFF)
AC_SUBST(DOCS_NONE)
AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="urogue"] )
AC_ARG_WITH(program-name, AS_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="urogue"] )
PROGRAM=$progname
AC_SUBST(PROGRAM)
AC_ARG_ENABLE(setgid, AC_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
AC_ARG_ENABLE(setgid, AS_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
AC_MSG_CHECKING([if using setgid execute bit])
if test "x$enable_setgid" = "xno" ; then
GROUPOWNER=
@ -77,7 +76,7 @@ fi
AC_SUBST(GROUPOWNER)
AC_ARG_ENABLE([scorefile],[AC_HELP_STRING([--enable-scorefile=SCOREFILE], [enable scoreboard with given filename])],[],[])
AC_ARG_ENABLE([scorefile],[AS_HELP_STRING([--enable-scorefile=SCOREFILE],[enable scoreboard with given filename])],[],[])
AC_MSG_CHECKING([for scoreboard file])
if test "x$enable_scorefile" = "xno" ; then
SCOREFILE=
@ -98,7 +97,7 @@ fi
AC_SUBST(SCOREFILE)
AC_ARG_ENABLE([logfile],[AC_HELP_STRING([--enable-logfile=LOGFILE], [enable logfile with given filename])],[],[])
AC_ARG_ENABLE([logfile],[AS_HELP_STRING([--enable-logfile=LOGFILE],[enable logfile with given filename])],[],[])
AC_MSG_CHECKING([for log file])
if test "x$enable_logfile" = "xno" ; then
LOGFILE=
@ -119,7 +118,7 @@ fi
AC_SUBST(LOGFILE)
AC_ARG_ENABLE([savedir],[AC_HELP_STRING([--enable-savedir=SAVEDIR], [enable systemwide location for saved games])],[],[enable_savedir="no"])
AC_ARG_ENABLE([savedir],[AS_HELP_STRING([--enable-savedir=SAVEDIR],[enable systemwide location for saved games])],[],[enable_savedir="no"])
AC_MSG_CHECKING([for save directory])
if test "x$enable_savedir" = "xno" ; then
SAVEDIR=
@ -142,7 +141,7 @@ fi
AC_SUBST(SAVEDIR)
AC_ARG_ENABLE([chardir],[AC_HELP_STRING([--enable-chardir=CHARDIR], [enable systemwide location for character files])],[],[enable_chardir="no"])
AC_ARG_ENABLE([chardir],[AS_HELP_STRING([--enable-chardir=CHARDIR],[enable systemwide location for character files])],[],[enable_chardir="no"])
AC_MSG_CHECKING([for character directory])
if test "x$enable_chardir" = "xno" ; then
CHARDIR=
@ -165,7 +164,7 @@ fi
AC_SUBST(CHARDIR)
AC_ARG_ENABLE([wizardmode],[AC_HELP_STRING([--enable-wizardmode], [enable availability of wizard mode @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([wizardmode],[AS_HELP_STRING([--enable-wizardmode],[enable availability of wizard mode @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if wizard mode is enabled])
if test "x$enable_wizardmode" = "xno" ; then
AC_MSG_RESULT([no])
@ -176,7 +175,7 @@ AC_DEFINE([WIZARD], [], [Define to include wizard mode])
AC_MSG_RESULT([yes])
fi
AC_ARG_ENABLE([memdebug],[AC_HELP_STRING([--enable-memdebug], [enable built-in memory checking @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([memdebug],[AS_HELP_STRING([--enable-memdebug],[enable built-in memory checking @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if memory checking is enabled])
if test "x$enable_memdebug" = "xno" ; then
AC_MSG_RESULT([no])

View file

@ -21,8 +21,6 @@
**
******************/
static char sccsid[] = "%W% %G%";
#include <stdlib.h>
#include <string.h>
#if !defined(OS2) && !defined(_WIN32)

View file

@ -18,8 +18,6 @@
#ifndef dict_h_included
#define dict_h_included
static char dict_sccsid[] = "%W% %G%";
#ifndef TRUE
#define TRUE 1
#define FALSE 0

View file

@ -12,8 +12,6 @@
** Utilities for Dictionary Maintenence Functions
*************************************************************************/
static char sccsid[] = "%W% %G%";
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

View file

@ -15,8 +15,6 @@
#ifndef dictutil_h_included
#define dictutil_h_included
static char dictutil_sccsid[] = "%W% %G%";
#include <stdio.h>
#include "dict.h"

View file

@ -401,54 +401,6 @@ md_shellescape()
#endif
}
int
directory_exists(char *dirname)
{
struct stat sb;
if (stat(dirname, &sb) == 0) /* path exists */
return (sb.st_mode & S_IFDIR);
return(0);
}
char *
md_getroguedir()
{
static char path[1024];
char *end,*home;
if ( (home = getenv("ROGUEHOME")) != NULL)
{
if (*home)
{
strncpy(path, home, PATH_MAX - 20);
end = &path[strlen(path)-1];
while( (end >= path) && ((*end == '/') || (*end == '\\')))
*end-- = '\0';
if (directory_exists(path))
return(path);
}
}
if (directory_exists("/var/games/roguelike"))
return("/var/games/roguelike");
if (directory_exists("/var/lib/roguelike"))
return("/var/lib/roguelike");
if (directory_exists("/var/roguelike"))
return("/var/roguelike");
if (directory_exists("/usr/games/lib"))
return("/usr/games/lib");
if (directory_exists("/games/roguelik"))
return("/games/roguelik");
if (directory_exists(md_gethomedir()))
return(md_gethomedir());
return("");
}
char *
md_getrealname(int uid)
{

View file

@ -19,8 +19,6 @@
#include "config.h"
#endif
static char sccsid[] = "%W%\t%G%";
/* Debugging memory allocation code that tries to trap common memory problems
like overwriting storage and stepping on memory pointer chains. If code
doesn't use malloc, free, and realloc a lot, these routines can be left in

View file

@ -955,9 +955,9 @@ wake_monster(int y, int x)
*/
if (off(player, CANTRUESEE) &&
on(*tp, ISINWALL) || on(*tp, CANSURPRISE) ||
(on(*tp, ISSHADOW) && rnd(100) < 80) ||
(on(*tp, ISINVIS) && off(player, CANSEE)))
(on(*tp, ISINWALL) || on(*tp, CANSURPRISE) ||
(on(*tp, ISSHADOW) && rnd(100) < 80) ||
(on(*tp, ISINVIS) && off(player, CANSEE))))
{
/*
TODO: incomplete - need to finish logic

View file

@ -37,7 +37,6 @@ new_level(LEVTYPE ltype, int special)
struct linked_list *item, *nitem;
struct thing *tp;
struct linked_list *fpack = NULL;
int going_down = TRUE;
coord stairs;
/* Start player off right */
@ -51,8 +50,6 @@ new_level(LEVTYPE ltype, int special)
if (level >= max_level)
max_level = level;
else
going_down = FALSE;
/* Free up the monsters on the last level */

View file

@ -6,8 +6,6 @@
All rights reserved.
*/
static char sccsid[] = "%W% %G%";
#include "rogue.h"
void verify_function(const char *file, const int line)

View file

@ -6,14 +6,10 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working curses], mp_cv_curses,
[LIBS="$LIBS -lcurses"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_curses=yes, mp_cv_curses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_curses=yes],[mp_cv_curses=no])])
if test "$mp_cv_curses" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
#AC_DEFINE(HAVE_CURSES_H)
CURSES_LIB="-lcurses"
fi
fi
@ -21,10 +17,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses,
[LIBS="$mp_save_LIBS -lncurses"
AC_TRY_LINK(
[#include <ncurses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_ncurses=yes, mp_cv_ncurses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ncurses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_ncurses=yes],[mp_cv_ncurses=no])])
if test "$mp_cv_ncurses" = yes
then
AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested])
@ -35,10 +28,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses,
[LIBS="$mp_save_LIBS -lpdcurses"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcurses=yes, mp_cv_pdcurses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcurses=yes],[mp_cv_pdcurses=no])])
if test "$mp_cv_pdcurses" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -49,10 +39,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working pdcur], mp_cv_pdcur,
[LIBS="$mp_save_LIBS -lpdcur"
AC_TRY_LINK(
[#include <curses.h>],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_pdcur=yes, mp_cv_pdcur=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_pdcur=yes],[mp_cv_pdcur=no])])
if test "$mp_cv_pdcur" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -63,10 +50,7 @@ AC_DEFUN([MP_WITH_CURSES],
then
AC_CACHE_CHECK([for working peer pdcurses], mp_cv_lpdcurses,
[LIBS="$mp_save_LIBS ../pdcurses/pdcurses.a"
AC_TRY_LINK(
[#include "../pdcurses/curses.h"],
[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
mp_cv_lpdcurses=yes, mp_cv_lpdcurses=no)])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "../pdcurses/curses.h"]], [[chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ]])],[mp_cv_lpdcurses=yes],[mp_cv_lpdcurses=no])])
if test "$mp_cv_lpdcurses" = yes
then
AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
@ -76,12 +60,10 @@ AC_DEFUN([MP_WITH_CURSES],
fi
AC_CACHE_CHECK([for ESCDELAY variable],
[mc_cv_ncurses_escdelay],
[AC_TRY_LINK([], [
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
extern int ESCDELAY;
ESCDELAY = 0;
],
[mc_cv_ncurses_escdelay=yes],
[mc_cv_ncurses_escdelay=no])
]])],[mc_cv_ncurses_escdelay=yes],[mc_cv_ncurses_escdelay=no])
])
if test "$mc_cv_ncurses_escdelay" = yes; then
AC_DEFINE(HAVE_ESCDELAY, 1,

View file

@ -320,7 +320,9 @@ command(void)
}
when 'i' : after = FALSE; inventory(pack, ALL);
when 'I' : after = FALSE; picky_inven();
when 'm' : nameitem((struct linked_list *)NULL, TRUE);
when 'm' :
after = FALSE;
nameitem((struct linked_list *)NULL, TRUE);
when 'o' : option();
when 'O' : msg("Charactor type: %s Quest item: %s", char_class[char_type].name, rel_magic[quest_item].mi_name);
when ',' :
@ -398,7 +400,7 @@ command(void)
food_left);
when CTRL('L') : after = FALSE; clearok(curscr, TRUE);
touchwin(cw);
when CTRL('N') : nameit();
when CTRL('N') : after = FALSE; nameit();
when CTRL('O') : after = FALSE; opt_player();
when CTRL('R') : after = FALSE; msg(huh);
when CTRL('T') :

View file

@ -1,17 +1,17 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.56)
AC_INIT([XRogue],[8.0.3], [yendor@rogueforge.net], [xrogue])
AC_PREREQ([2.69])
AC_INIT([XRogue],[8.0.3],[elwin@sdf.org],[xrogue])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_AUX_DIR([../build-aux])
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
MP_WITH_CURSES
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([pwd.h errno.h fcntl.h limits.h stdlib.h string.h sys/ioctl.h sys/utsname.h termios.h unistd.h term.h ncurses/term.h process.h arpa/inet.h])
# Checks for typedefs, structures, and compiler characteristics.
@ -21,15 +21,14 @@ AC_STRUCT_TM
AC_FUNC_FORK
AC_PROG_GCC_TRADITIONAL
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([erasechar killchar alarm getpass memset setenv strchr _spawnl spawnl getpwuid loadav strerror setgid setuid getuid getgid])
AC_PROG_INSTALL
AC_ARG_WITH(program-name, AC_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="xrogue"] )
AC_ARG_WITH(program-name, AS_HELP_STRING([--with-program-name=NAME],[alternate executable name]),[progname="$withval" ], [progname="xrogue"] )
PROGRAM=$progname
AC_SUBST(PROGRAM)
AC_ARG_ENABLE(setgid, AC_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
AC_ARG_ENABLE(setgid, AS_HELP_STRING([--enable-setgid=NAME],[install executable as setgid with group ownership of NAME @<:@default=no@:>@]),[],[])
AC_MSG_CHECKING([if using setgid execute bit])
if test "x$enable_setgid" = "xno" ; then
GROUPOWNER=
@ -50,7 +49,7 @@ fi
AC_SUBST(GROUPOWNER)
AC_ARG_ENABLE([scorefile],[AC_HELP_STRING([--enable-scorefile=SCOREFILE], [enable scoreboard with given filename])],[],[])
AC_ARG_ENABLE([scorefile],[AS_HELP_STRING([--enable-scorefile=SCOREFILE],[enable scoreboard with given filename])],[],[])
AC_MSG_CHECKING([for scoreboard file])
if test "x$enable_scorefile" = "xno" ; then
SCOREFILE=
@ -71,7 +70,7 @@ fi
AC_SUBST(SCOREFILE)
AC_ARG_ENABLE([logfile],[AC_HELP_STRING([--enable-logfile=LOGFILE], [enable logfile with given filename])],[],[])
AC_ARG_ENABLE([logfile],[AS_HELP_STRING([--enable-logfile=LOGFILE],[enable logfile with given filename])],[],[])
AC_MSG_CHECKING([for log file])
if test "x$enable_logfile" = "xno" ; then
LOGFILE=
@ -92,7 +91,7 @@ fi
AC_SUBST(LOGFILE)
AC_ARG_ENABLE([savedir],[AC_HELP_STRING([--enable-savedir=SAVEDIR], [enable systemwide location for saved games])],[],[enable_savedir="no"])
AC_ARG_ENABLE([savedir],[AS_HELP_STRING([--enable-savedir=SAVEDIR],[enable systemwide location for saved games])],[],[enable_savedir="no"])
AC_MSG_CHECKING([for save directory])
if test "x$enable_savedir" = "xno" ; then
SAVEDIR=
@ -115,7 +114,7 @@ fi
AC_SUBST(SAVEDIR)
AC_ARG_ENABLE([wizardmode],[AC_HELP_STRING([--enable-wizardmode], [enable availability of wizard mode @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([wizardmode],[AS_HELP_STRING([--enable-wizardmode],[enable availability of wizard mode @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if wizard mode is enabled])
if test "x$enable_wizardmode" = "xno" ; then
AC_MSG_RESULT([no])
@ -126,7 +125,7 @@ AC_DEFINE([WIZARD], [], [Define to include wizard mode])
AC_MSG_RESULT([yes])
fi
AC_ARG_ENABLE([limitscore],[AC_HELP_STRING([--enable-limitscore], [limit scores to one per class per uid @<:@default=no@:>@])],[],[])
AC_ARG_ENABLE([limitscore],[AS_HELP_STRING([--enable-limitscore],[limit scores to one per class per uid @<:@default=no@:>@])],[],[])
AC_MSG_CHECKING([if limiting scores])
if test "x$enable_limitscore" = "xno" ; then
AC_MSG_RESULT([no])

View file

@ -20,6 +20,7 @@
#include <string.h>
#include <curses.h>
#include <signal.h>
#include <limits.h>
#include <time.h>
#include "mach_dep.h"
@ -44,6 +45,7 @@ main(int argc, char *argv[], char *envp[])
*/
strncpy(home, md_gethomedir(), LINELEN);
home[LINELEN-1] = '\0';
/* Get default save file */
strcpy(file_name, home);
@ -51,8 +53,8 @@ main(int argc, char *argv[], char *envp[])
/* Get default score file */
#ifdef SCOREFILE
strncpy(score_file, SCOREFILE, LINELEN);
score_file[LINELEN-1] = '\0';
strncpy(score_file, SCOREFILE, PATH_MAX);
score_file[PATH_MAX-1] = '\0';
#else
strcpy(score_file, md_getroguedir());

View file

@ -630,12 +630,12 @@ wake_monster(int y, int x)
/*
* Every time he sees mean monster, it might start chasing him
*/
if (on(*tp, ISMEAN) &&
if ((on(*tp, ISMEAN) &&
off(*tp, ISHELD) &&
off(*tp, ISRUN) &&
rnd(100) > 35 &&
(!is_stealth(&player) || (on(*tp, ISUNIQUE) && rnd(100) > 35)) &&
(off(player, ISINVIS) || on(*tp, CANSEE)) ||
(off(player, ISINVIS) || on(*tp, CANSEE))) ||
(trp != NULL && (trp->r_flags & ISTREAS))) {
runto(tp, &hero);
}

View file

@ -21,7 +21,6 @@
/* #undef NETCOMMAND "uux - -n '%s!%s -u' >/dev/null 2>&1" */
/* #define NETCOMMAND "usend -s -d%s -uNoLogin -!'%s -u' - 2>/dev/null" */
#define NETCOMMAND ""
/* Networking information -- should not vary among networking machines */

View file

@ -24,6 +24,7 @@
#include <curses.h>
#include <ctype.h>
#include <string.h>
#include <limits.h>
#include "rogue.h"
#define NUM_OPTS (sizeof optlist / sizeof (OPTION))
@ -524,7 +525,7 @@ get_str_prot(char *opt, WINDOW *win)
int
get_score(char *optstr, WINDOW *win)
{
char old_score_file[LINELEN];
char old_score_file[PATH_MAX];
int status;
if (use_savedir)

View file

@ -420,6 +420,7 @@ score(unsigned long amount, int flags, short monst)
(flags == WINNER) ? (short) max_level : (short) level,
monst, player.t_ctype, thissys, login)
) {
#ifdef NETCOMMAND
/* Send this update to the other systems in the network */
int i, j;
char cmd[256]; /* Command for remote execution */
@ -472,6 +473,7 @@ score(unsigned long amount, int flags, short monst)
(void) pclose(rmf);
}
}
#endif
}
}
}

View file

@ -18,6 +18,7 @@
#include <ctype.h>
#include <curses.h>
#include <limits.h>
#include "rogue.h"
/*
@ -90,7 +91,7 @@ char *ws_guess[MAXSTICKS]; /* Players guess at what wand is */
char *m_guess[MAXMM]; /* Players guess at what MM is */
char *ws_type[MAXSTICKS]; /* Is it a wand or a staff */
char file_name[LINELEN]; /* Save file name */
char score_file[LINELEN]; /* Score file name */
char score_file[PATH_MAX]; /* Score file name */
char home[LINELEN]; /* User's home directory */
WINDOW *cw; /* Window that the player sees */
WINDOW *hw; /* Used for the help command */

View file

@ -1347,7 +1347,7 @@ void init_player(void);
void init_stones(void);
void init_terrain(void);
void init_things(void);
void init_weapon(struct object *weap, char type);
void init_weapon(struct object *weap, int type);
char *inv_name(struct object *obj, bool drop);
bool inventory(struct linked_list *list, int type);
bool invisible(struct thing *monst);

View file

@ -3301,7 +3301,7 @@ directory_exists(char *dirname)
char *
md_getroguedir(void)
{
static char path[1024];
static char path[PATH_MAX-20];
char *end,*home;
if ( (home = getenv("ROGUEHOME")) != NULL)
@ -3310,14 +3310,17 @@ md_getroguedir(void)
{
strncpy(path, home, PATH_MAX - 20);
end = &path[strlen(path)-1];
if (path[PATH_MAX-21] == '\0')
{
end = &path[strlen(path)-1];
while( (end >= path) && ((*end == '/') || (*end == '\\')))
*end-- = '\0';
while( (end >= path) && ((*end == '/') || (*end == '\\')))
*end-- = '\0';
if (directory_exists(path))
return(path);
if (directory_exists(path))
return(path);
}
}
}

View file

@ -323,7 +323,7 @@ do_zap(struct thing *zapper, struct object *obj, coord *direction, int which,
if (!obj)
dice = zapper->t_stats.s_lvl;
if (obj->o_type == RELIC)
else if (obj->o_type == RELIC)
dice = 15;
else if (EQUAL(ws_type[which], "staff"))
dice = 10;

View file

@ -198,7 +198,7 @@ hit_monster(int y, int x, struct object *obj, struct thing *tp)
*/
void
init_weapon(struct object *weap, char type)
init_weapon(struct object *weap, int type)
{
register struct init_weps *iwp;