(main,mobility_check,upda,turn,rea,mobupdate,ef_open,logerror,

emp_config,gamedown,show_motd,match_user,typed_wu,
delete_old_announcements) [_WIN32]: switch the default file mode to
binary to match POSIX.  Remove the now unneccessary ifdef for
the open/fopen. Add text mode for user files (econfig/auth).
This commit is contained in:
Ron Koenderink 2004-12-30 01:31:03 +00:00
parent f6e78f4589
commit 1a8488bc45
13 changed files with 14 additions and 65 deletions

View file

@ -92,7 +92,7 @@ emp_config(char *file)
fixup_files();
return 0;
}
if ((fp = fopen(file, "r")) == NULL) {
if ((fp = fopen(file, "rt")) == NULL) {
fprintf(stderr, "Can't open %s for reading (%s)\n",
file, strerror(errno));
return -1;
@ -181,11 +181,7 @@ static struct otherfiles ofiles[] = {
{&annfil, "ann"},
{&timestampfil, "timestamp"},
{&teldir, "tel"},
#if !defined(_WIN32)
{&telfil, "tel/tel"},
#else
{&telfil, "tel\\tel"},
#endif
{NULL, NULL}
};
@ -198,20 +194,12 @@ fixup_files(void)
s_char buf[1024];
for (ep = empfile; ep < &empfile[EF_MAX]; ep++) {
#if !defined(_WIN32)
sprintf(buf, "%s/%s", datadir, ep->name);
#else
sprintf(buf, "%s\\%s", datadir, ep->name);
#endif
ep->file = strdup(buf);
}
for (op = ofiles; op->files; op++) {
#if !defined(_WIN32)
sprintf(buf, "%s/%s", datadir, op->name);
#else
sprintf(buf, "%s\\%s", datadir, op->name);
#endif
*op->files = strdup(buf);
}
}