summaryrefslogtreecommitdiff
path: root/common/file.cpp
diff options
context:
space:
mode:
authorleo2003-07-30 17:25:26 +0000
committerleo2003-07-30 17:25:26 +0000
commit7a0f908c5512e2e963d78361a87a0d35fd5f1a92 (patch)
tree02db7e25e973fbb774552196c0ee02ee7ed17efc /common/file.cpp
parent8019b524d8a17d313dec97f56845c3a40d4df291 (diff)
Store file names in the File class.
git-svn-id: http://svn.leocad.org/trunk@343 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'common/file.cpp')
-rw-r--r--common/file.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/file.cpp b/common/file.cpp
index e57d58c..2df77f1 100644
--- a/common/file.cpp
+++ b/common/file.cpp
@@ -15,6 +15,7 @@
File::File ()
{
+ strcpy(FileName, "");
}
File::~File ()
@@ -399,6 +400,8 @@ int FileDisk::PutChar(int c)
bool FileDisk::Open(const char *filename, const char *mode)
{
+ strcpy(FileName, filename);
+
m_hFile = fopen(filename, mode);
m_bCloseOnDelete = true;
@@ -414,6 +417,7 @@ void FileMem::Close()
if (m_pBuffer && m_bAutoDelete)
free(m_pBuffer);
m_pBuffer = NULL;
+ strcpy(FileName, "");
}
void FileDisk::Close()
@@ -423,6 +427,7 @@ void FileDisk::Close()
m_hFile = NULL;
m_bCloseOnDelete = false;
+ strcpy(FileName, "");
}
unsigned long FileMem::Seek(long lOff, int nFrom)