From 91b4bd0da92a100e41d279ffdfca890948df3506 Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 11 Nov 2019 11:46:49 -0500 Subject: [PATCH] new prefix_locked bits conditionalized to WIN32 --- include/decl.h | 2 ++ src/decl.c | 4 +++- src/files.c | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/decl.h b/include/decl.h index ff7404af3..c2e0648e1 100644 --- a/include/decl.h +++ b/include/decl.h @@ -398,7 +398,9 @@ E const char *const monexplain[], invisexplain[], *const oclass_names[]; #endif E char *fqn_prefix[PREFIX_COUNT]; +#ifdef WIN32 E boolean fqn_prefix_locked[PREFIX_COUNT]; +#endif #ifdef PREFIXES_IN_USE E char *fqn_prefix_names[PREFIX_COUNT]; #endif diff --git a/src/decl.c b/src/decl.c index d732df35c..d3706ef3b 100644 --- a/src/decl.c +++ b/src/decl.c @@ -286,11 +286,13 @@ char *fqn_prefix[PREFIX_COUNT] = { (char *) 0, (char *) 0, (char *) 0, (char *) 0, (char *) 0, (char *) 0, (char *) 0, (char *) 0, (char *) 0, (char *) 0 }; +#ifdef WIN32 boolean fqn_prefix_locked[PREFIX_COUNT] = { FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE }; - +#endif + #ifdef PREFIXES_IN_USE char *fqn_prefix_names[PREFIX_COUNT] = { "hackdir", "leveldir", "savedir", "bonesdir", "datadir", diff --git a/src/files.c b/src/files.c index e9af0a3c5..f8e77cfdf 100644 --- a/src/files.c +++ b/src/files.c @@ -2159,8 +2159,10 @@ int prefixid; if (!bufp) return; +#ifdef WIN32 if (fqn_prefix_locked[prefixid]) return; +#endif /* Backward compatibility, ignore trailing ;n */ if ((ptr = index(bufp, ';')) != 0) *ptr = '\0'; @@ -3870,9 +3872,10 @@ assure_syscf_file() { int fd; +#ifdef WIN32 /* We are checking that the sysconf exists ... lock the path */ fqn_prefix_locked[SYSCONFPREFIX] = TRUE; - +#endif /* * All we really care about is the end result - can we read the file? * So just check that directly.