some, but not all, vms issues fixed

This commit is contained in:
nhmall
2019-11-12 19:58:48 -05:00
parent ec91626316
commit bc0d78138f
6 changed files with 39 additions and 14 deletions

View File

@@ -34,7 +34,7 @@ $ gnuc_ = "GCC"
$ if f$type(gcc).eqs."STRING" then gnuc_ = gcc
$ gnulib = "gnu_cc:[000000]gcclib/Library" !(not used w/ vaxc)
$ ! common CC options (/obj=file doesn't work for GCC 1.36, use rename instead)
$ c_c_ = "/INCLUDE=[-.INCLUDE]"
$ c_c_ = "/INCLUDE=([-.INCLUDE],[-.-.LUA535.SRC])/DEFINE=(""LUA_USE_C89"", ""LUA_32BITS"")"
$ veryold_vms = f$extract(1,1,f$getsyi("VERSION")).eqs."4" -
.and. f$extract(3,3,f$getsyi("VERSION")).lts."6"
$ if veryold_vms then c_c_ = c_c_ + "/DEFINE=(""VERYOLD_VMS"")"

View File

@@ -32,7 +32,7 @@ main(argc, argv)
int argc;
char *argv[];
{
register int fd;
NHFILE *nhfp;
#ifdef CHDIR
register char *dir;
#endif
@@ -49,7 +49,7 @@ char *argv[];
atexit(byebye);
g.hname = argv[0];
g.hname = vms_basename(g.hname); /* name used in 'usage' type messages */
hackpid = getpid();
g.hackpid = getpid();
(void) umask(0);
choose_windows(DEFAULT_WINDOW_SYS);
@@ -67,8 +67,25 @@ char *argv[];
dir = nh_getenv("HACKDIR");
#endif
if (argc > 1) {
if (argcheck(argc, argv, ARG_VERSION) == 2)
exit(EXIT_SUCCESS);
if (argcheck(argc, argv, ARG_SHOWPATHS) == 2) {
#ifdef CHDIR
if (!strncmp(argv[1], "-d", 2) && argv[1][2] != 'e') {
chdirx((char *) 0, 0);
#endif
iflags.initoptions_noterminate = TRUE;
initoptions();
iflags.initoptions_noterminate = FALSE;
reveal_paths();
exit(EXIT_SUCCESS);
}
if (argcheck(argc, argv, ARG_DEBUG) == 1) {
argc--;
argv++;
}
#ifdef CHDIR
if (argc > 1 && !strncmp(argv[1], "-d", 2) && argv[1][2] != 'e') {
/* avoid matching "-dec" for DECgraphics; since the man page
* says -d directory, hope nobody's using -desomething_else
*/
@@ -175,7 +192,7 @@ char *argv[];
* We'll return here if new game player_selection() renames the hero.
*/
attempt_restore:
if ((fd = restore_saved_game()) >= 0) {
if ((nhfp = restore_saved_game()) != 0) {
const char *fq_save = fqname(g.SAVEF, SAVEPREFIX, 1);
(void) chmod(fq_save, 0); /* disallow parallel restores */
@@ -188,7 +205,7 @@ attempt_restore:
#endif
pline("Restoring save file...");
mark_synch(); /* flush output */
if (dorecover(fd)) {
if (dorecover(nhfp)) {
resuming = TRUE; /* not starting new game */
wd_message();
if (discover || wizard) {

View File

@@ -110,7 +110,7 @@ getlock()
'a','b',&c below; override the default and use <uid><charname>
if we aren't restricting the number of simultaneous games */
if (!g.locknum)
Sprintf(g.lock, "_%u%s", (unsigned) getuid(), plname);
Sprintf(g.lock, "_%u%s", (unsigned) getuid(), g.plname);
regularize(g.lock);
set_levelfile_name(g.lock, 0);