From 080430b3bda2bec05362119447d51b6c37f1cfc1 Mon Sep 17 00:00:00 2001 From: Steven Fuller Date: Tue, 18 Dec 2001 05:08:52 +0000 Subject: Redid the most of the file loading/saving. Now uses $HOME/.avp/ and $AVP_DIR to look for files. --- src/win95/db.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/win95/db.c') diff --git a/src/win95/db.c b/src/win95/db.c index 228bb1b..a9d63c7 100644 --- a/src/win95/db.c +++ b/src/win95/db.c @@ -85,7 +85,7 @@ int db_option = 0; /* Default is off. */ * logfile will go in the directory that is current when db_log_init() * is called. */ -#define ABSOLUTE_PATH 0 +#define ABSOLUTE_PATH 1 /* M A C R O S ******************************************************** */ @@ -152,12 +152,14 @@ static const char* db_assert_textA[ 3 ] = "Expression: %s", "File: %s Line: %d" }; -#if 0 + +#ifndef DB_NOWINDOWS static const char* db_prompt_std = "Quit program/force e(x)ception? [y/n/x]"; static const char* db_prompt_windows = "Quit program? [Yes/No]/force exception? [Cancel]"; #endif + static const char* db_assert_log_begin_text = "DB: FAILED ASSERTION BEGINS"; static const char* db_assert_log_end_text = @@ -394,7 +396,7 @@ void db_log_fired(const char *strP) if(!InitialisedLog) db_log_init(); { /* Open a file for appending, creating one if it doesn't yet exist. */ - FILE *fP = fopen(LogFileNameP, "a+"); + FILE *fP = OpenGameFile(LogFileNameP, FILEMODE_APPEND, FILETYPE_CONFIG); if(!fP) return; @@ -409,13 +411,12 @@ void db_log_init(void) sprintf( LogFileNameP, "%s", db_log_file_name ); #else /* Append the log file name to the current working directory. */ -/* TODO - path seperator */ sprintf( LogFileNameP, "%s/%s", getcwd( LogFileNameP, 240 ), db_log_file_name ); #endif /* Delete old log file. */ - remove(LogFileNameP); + DeleteGameFile(LogFileNameP); /* Flag that we have initialised the log file. */ InitialisedLog = 1; -- cgit v1.3