saved-games menu for vms (1 of 2) (trunk only)

First cut at implementing SELECTSAVED for VMS.  Unfortunately, it only
works by default if the player is using a [probably] shared account called
"games" or "nethack", and displaying a menu of games available to restore
will likely have the side-effect of encouraging other players sharing that
account to steal each others saved games.  To use it with a normal account,
the player has to include "-ugames" or "-unethack" on the command line
(or OPTIONS=name:games in config file) to force the program to reach the
"Who are you?" stage.

     I've added a flag argument to set_savefile_name() so regularization
can be suppressed, allowing it to be used to construct a wildcarded file
specification.  I'm using that for VMS and have attempted to put in place
for WIN32CON, but the latter is not tested.

     The current WIN32CON and UNIX+QT_GRAPHICS methods of collecting save
file names is bug-prone if used on a shared playground directory.  Counting
matching file names first, then allocating memory and retraversing the
directory to copy those names into the allocated memory has a window of
vulnerability where the number of matching files could increase between the
counting and the copying.
This commit is contained in:
nethack.rankin
2006-12-10 04:46:57 +00:00
parent a00a69ba26
commit a654734476
3 changed files with 55 additions and 27 deletions

View File

@@ -74,6 +74,12 @@
*/
#define DLB /* use data librarian code */
/*
* Provide menu of saved games to choose from at start.
* [Player needs to use ``nethack "-ugames"'' for this to work.]
*/
#define SELECTSAVED
/*
* You may define TEXTCOLOR if your system has any terminals that recognize
* ANSI color sequences of the form ``<ESCAPE>[#;#m'', where the first # is