From 3ad4abe6cebfb060e7c746f0134c22b734b5d8fa Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 26 Sep 2001 03:09:35 +0000 Subject: [PATCH] Make sure that the writing functions get used when a write mode is specified. --- archivers/dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/archivers/dir.c b/archivers/dir.c index 34ccb350..27f037b2 100644 --- a/archivers/dir.c +++ b/archivers/dir.c @@ -209,7 +209,6 @@ static DirHandle *DIR_openArchive(const char *name, int forWriting) if (strcmp((name + namelen) - seplen, dirsep) != 0) strcat((char *) (retval->opaque), dirsep); - retval->funcs = &__PHYSFS_DirFunctions_DIR; return(retval); } /* DIR_openArchive */ @@ -293,7 +292,8 @@ static FileHandle *doOpen(DirHandle *h, const char *name, const char *mode) retval->opaque = (void *) rc; retval->dirHandle = h; - retval->funcs = &__PHYSFS_FileFunctions_DIR; + retval->funcs = (mode[0] == 'r') ? + &__PHYSFS_FileFunctions_DIR : &__PHYSFS_FileFunctions_DIRW; return(retval); } /* doOpen */