From 2c687d3388261e3ed3a4b14721f1d23e0a735607 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 29 Jun 2004 12:07:15 +0000 Subject: Make md5_file() work regardless file name case and within arbitrary directory. svn-id: r14123 --- common/md5.cpp | 4 ++-- common/md5.h | 2 +- 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 -- cgit v1.2.3