Merge branch 'NetHack-3.6'
This commit is contained in:
100
src/files.c
100
src/files.c
@@ -3428,7 +3428,13 @@ fopen_sym_file()
|
||||
{
|
||||
FILE *fp;
|
||||
|
||||
fp = fopen_datafile(SYMBOLS, "r", HACKPREFIX);
|
||||
fp = fopen_datafile(SYMBOLS, "r",
|
||||
#ifdef WIN32
|
||||
SYSCONFPREFIX
|
||||
#else
|
||||
HACKPREFIX
|
||||
#endif
|
||||
);
|
||||
|
||||
return fp;
|
||||
}
|
||||
@@ -4227,6 +4233,98 @@ boolean wildcards;
|
||||
|
||||
#endif /*DEBUG*/
|
||||
|
||||
void
|
||||
reveal_paths(VOID_ARGS)
|
||||
{
|
||||
int i;
|
||||
#define PATHBUFSZ 1024
|
||||
char buf[PATHBUFSZ];
|
||||
#ifdef UNIX
|
||||
char *envp, *slash, nhpath[PATHBUFSZ];
|
||||
#endif
|
||||
|
||||
/* write out path details */
|
||||
#ifdef PREFIXES_IN_USE
|
||||
raw_print("Variable playground locations:");
|
||||
for (i = 0; i < PREFIX_COUNT; i++)
|
||||
raw_printf(" [%-10s]=\"%s\"", fqn_prefix_names[i],
|
||||
g.fqn_prefix[i]
|
||||
? g.fqn_prefix[i]
|
||||
: "not set");
|
||||
#endif
|
||||
/* sysconf file */
|
||||
#ifdef PREFIXES_IN_USE
|
||||
Sprintf(buf, " (in %s)",
|
||||
fqn_prefix_names[SYSCONFPREFIX]);
|
||||
#else
|
||||
buf[0] = '\0';
|
||||
#endif
|
||||
raw_printf("Your system configuration file%s:", buf);
|
||||
set_configfile_name(fqname(SYSCF_FILE, SYSCONFPREFIX, 0));
|
||||
raw_printf(" \"%s\"", configfile);
|
||||
#ifdef UNIX
|
||||
Strcpy(nhpath, configfile);
|
||||
slash = rindex(nhpath, '/');
|
||||
if (slash)
|
||||
*slash = '\0';
|
||||
#endif
|
||||
|
||||
/* symbols file */
|
||||
#ifdef PREFIXES_IN_USE
|
||||
Sprintf(buf, " (in %s)",
|
||||
#ifdef WIN32
|
||||
fqn_prefix_names[SYSCONFPREFIX]);
|
||||
#else
|
||||
fqn_prefix_names[HACKPREFIX]);
|
||||
#endif /* WIN32 */
|
||||
#else /* PREFIXES_IN_USE */
|
||||
buf[0] = '\0';
|
||||
#endif
|
||||
|
||||
raw_printf("Your system symbols file%s:", buf);
|
||||
#ifdef UNIX
|
||||
Sprintf(buf, "%s/%s", nhpath, SYMBOLS);
|
||||
#else
|
||||
#ifdef PREFIXES_IN_USE
|
||||
Sprintf(buf, "%s",
|
||||
fqname(SYMBOLS,
|
||||
#ifdef WIN32
|
||||
SYSCONFPREFIX, 2));
|
||||
#else
|
||||
HACKPREFIX, 2));
|
||||
#endif
|
||||
#endif /* PREFIXES_IN_USE */
|
||||
#endif /* UNIX */
|
||||
raw_printf(" \"%s\"", buf);
|
||||
|
||||
/* configuration file */
|
||||
#ifdef PREFIXES_IN_USE
|
||||
Sprintf(buf, " (in %s)",
|
||||
fqn_prefix_names[CONFIGPREFIX]);
|
||||
#else /* PREFIXES_IN_USE */
|
||||
buf[0] = '\0';
|
||||
#endif
|
||||
raw_printf("Your personal configuration file%s:", buf);
|
||||
#ifdef UNIX
|
||||
envp = nh_getenv("HOME");
|
||||
if (!envp)
|
||||
Strcpy(nhpath, ".nethackrc");
|
||||
else
|
||||
Sprintf(nhpath, "%s/%s", envp, default_configfile);
|
||||
#endif
|
||||
raw_printf(" \"%s\"",
|
||||
#ifdef UNIX
|
||||
nhpath);
|
||||
#else
|
||||
#ifdef PREFIXES_IN_USE
|
||||
fqname(default_configfile, CONFIGPREFIX, 3));
|
||||
#else
|
||||
default_configfile);
|
||||
#endif /* PREFIXES_IN_USE */
|
||||
#endif /* UNIX */
|
||||
raw_print("");
|
||||
}
|
||||
|
||||
/* ---------- BEGIN TRIBUTE ----------- */
|
||||
|
||||
/* 3.6 tribute code
|
||||
|
||||
Reference in New Issue
Block a user