(empfile, teldir, motdfil, downfil, disablefil, telfil, annfil)
(banfil, authfil, timestampfil): Make file names relative to DATADIR. (main): emp_server and files change to the data directory. fairland has to write newcap_script to the initial current directory, so it keeps it and makes file names relative to DATADIR absolute. (fixup_files): Nothing to do, remove. This fixes the following bug: fixup_files() formed file names by appending ep->name instead of the base name of ep->file to datadir. Thus, fixup_files() changed file names even when datadir had the compiled-in value. When emp_config() couldn't open econfig, it failed to call fixup_files(), and different file names got used. Note that with this revision the file names revert to the names used before fixup_files() was introduced. Closes #1146080. (print_config): Printing file names as comments is not really useful, remove. (otherfiles, ofiles): Unused, remove. (emp_config, main): Previously, pconfig had to call emp_config() even when it didn't want to read econfig, just to run fixup_files(). This is no longer necessary. Simplify.
This commit is contained in:
parent
1583d0c6a2
commit
29da4b6cf4
8 changed files with 49 additions and 92 deletions
|
@ -64,13 +64,11 @@ static int quiet = 0;
|
|||
/* lower URAN_MIN for more uranium */
|
||||
#define URAN_MIN 56
|
||||
|
||||
#if defined(aix) || defined(linux) || defined(solaris)
|
||||
#include <unistd.h>
|
||||
#endif /* aix or linux */
|
||||
#if defined(_WIN32)
|
||||
#include "../lib/gen/getopt.h"
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -402,12 +400,16 @@ static int
|
|||
allocate_memory(void)
|
||||
{
|
||||
int i;
|
||||
char *fname;
|
||||
|
||||
sect_fptr = fopen(empfile[EF_SECTOR].file, "wb");
|
||||
fname = malloc(strlen(datadir) + 1 + strlen(empfile[EF_SECTOR].file) + 1);
|
||||
sprintf(fname, "%s/%s", datadir, empfile[EF_SECTOR].file);
|
||||
sect_fptr = fopen(fname, "wb");
|
||||
if (sect_fptr == NULL) {
|
||||
perror(empfile[EF_SECTOR].file);
|
||||
perror(fname);
|
||||
return -1;
|
||||
}
|
||||
free(fname);
|
||||
sectsbuf =
|
||||
(struct sctstr *)calloc((YSIZE * XSIZE), sizeof(struct sctstr));
|
||||
sects = (struct sctstr **)calloc(YSIZE, sizeof(struct sctstr *));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue