vms file access

Fix the problem From a bug report.  His system has a logical name "DATA" pointing at some disk, and
when the dlb utility tried to open "data" for inclusion in the library
being built at install time, it attempted to access the wrong thing and
failed.  He then attempted to fix it in a manner which let dlb finish, by
modifying dlb_main.c to append "." to file names that lack a dot, but
then nethack couldn't access "dungeon" in the library because string
comparison didn't match the altered dlb directory entry of "dungeon.".

     NetHack was working around this unintended interaction with the
environment issue in fopen_datafile(), and dlb was doing so for fopen()
but not open().  This moves nethack's fixup out of src/files.c and into
sys/vms/vmsfiles.c, adds another routine there so that both open() and
fopen() are covered, and updates the vms Makefiles so that the various
utility programs all link with vmsfiles.  (The build script vmsbuild.com
puts object files into a library and gets that last bit for free.)
This commit is contained in:
nethack.rankin
2007-10-28 09:37:56 +00:00
parent cac2dd4d33
commit a675cc6ed7
7 changed files with 64 additions and 57 deletions

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)vmsconf.h 3.5 2006/09/22 */
/* SCCS Id: @(#)vmsconf.h 3.5 2007/10/27 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -247,6 +247,7 @@ typedef __mode_t mode_t;
#define getuid() vms_getuid() /* vmsunix.c */
#define link(f1,f2) vms_link(f1,f2) /* vmsfiles.c */
#define open(f,k,m) vms_open(f,k,m) /* vmsfiles.c */
#define fopen(f,m) vms_fopen(f,m) /* vmsfiles.c */
/* #define unlink(f0) vms_unlink(f0) /* vmsfiles.c */
#ifdef VERYOLD_VMS
#define unlink(f0) delete(f0) /* vaxcrtl */
@@ -266,6 +267,8 @@ typedef __mode_t mode_t;
/* used in several files which don't #include "extern.h" */
extern void FDECL(vms_exit, (int));
extern int FDECL(vms_open, (const char *,int,unsigned));
extern FILE *FDECL(vms_fopen, (const char *,const char *));
char *FDECL(vms_basename, (const char *)); /* vmsfiles.c */
#endif /* VMSCONF_H */
#endif /* VMS */