aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2004-06-29 12:07:15 +0000
committerEugene Sandulenko2004-06-29 12:07:15 +0000
commit2c687d3388261e3ed3a4b14721f1d23e0a735607 (patch)
tree0e043981507e5b723b6be728bd8fbf6f673838d4
parent26e38321dfca639f11fcb0d70e64b7f00f5884d7 (diff)
downloadscummvm-rg350-2c687d3388261e3ed3a4b14721f1d23e0a735607.tar.gz
scummvm-rg350-2c687d3388261e3ed3a4b14721f1d23e0a735607.tar.bz2
scummvm-rg350-2c687d3388261e3ed3a4b14721f1d23e0a735607.zip
Make md5_file() work regardless file name case and within arbitrary
directory. svn-id: r14123
-rw-r--r--common/md5.cpp4
-rw-r--r--common/md5.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/common/md5.cpp b/common/md5.cpp
index 52af84b3c7..55b2aef79a 100644
--- a/common/md5.cpp
+++ b/common/md5.cpp
@@ -239,14 +239,14 @@ void md5_finish( md5_context *ctx, uint8 digest[16] )
PUT_UINT32( ctx->state[3], digest, 12 );
}
-bool md5_file( const char *name, uint8 digest[16] )
+bool md5_file( const char *name, uint8 digest[16], const char *directory )
{
File f;
md5_context ctx;
int i;
unsigned char buf[1000];
- f.open(name);
+ f.open(name, File::kFileReadMode, directory);
if( ! f.isOpen() )
{
warning( "md5_file couldn't open '%s'", name );
diff --git a/common/md5.h b/common/md5.h
index 045e821f80..fe83ebda84 100644
--- a/common/md5.h
+++ b/common/md5.h
@@ -35,6 +35,6 @@ void md5_starts( md5_context *ctx );
void md5_update( md5_context *ctx, const uint8 *input, uint32 length );
void md5_finish( md5_context *ctx, uint8 digest[16] );
-bool md5_file( const char *name, uint8 digest[16] );
+bool md5_file( const char *name, uint8 digest[16], const char *directory = NULL );
#endif