From e0f5120b9d716419df98dfda0f80be47d5c66259 Mon Sep 17 00:00:00 2001 From: Jeremy Sowden Date: Mon, 27 May 2019 22:52:07 +0100 Subject: [PATCH] wmail: FileNameConcat does exactly the same thing as MakePathName: get rid of it. --- wmail/src/wmail.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/wmail/src/wmail.c b/wmail/src/wmail.c index 40d932c..df3b613 100644 --- a/wmail/src/wmail.c +++ b/wmail/src/wmail.c @@ -188,7 +188,6 @@ void MarkName( unsigned long checksum ); void DetermineState(); void UpdateConfiguration(); void CleanupNames(); -char *FileNameConcat( const char *path, const char *fileName ); bool HasTickerWork(); @@ -633,7 +632,7 @@ void CheckMaildir() while(( dirEnt = readdir( dir )) != NULL ) { - char *fullName = FileNameConcat( config.mailBox, dirEnt->d_name ); + char *fullName = MakePathName( config.mailBox, dirEnt->d_name ); struct stat fileStat; if ( fullName == NULL ) @@ -682,7 +681,7 @@ int TraverseDirectory( const char *name, bool isNewMail ) while(( dirEnt = readdir( dir )) != NULL ) { - char *fullName = FileNameConcat( name, dirEnt->d_name ); + char *fullName = MakePathName( name, dirEnt->d_name ); struct stat fileStat; unsigned long checksum = 0; name_t *name; @@ -723,25 +722,6 @@ int TraverseDirectory( const char *name, bool isNewMail ) return mails; } -char *FileNameConcat( const char *path, const char *fileName ) -{ - int len1 = strlen( path ); - int len2 = strlen( fileName ); - char *buf; - - if( path[len1-1] == '/' ) - --len1; - - buf = (char *)malloc( len1 + len2 + 2 ); - - memcpy( buf, path, len1 ); - buf[len1] = '/'; - memcpy( &buf[len1+1], fileName, len2 ); - buf[len1+len2+1] = '\0'; - - return buf; -} - name_t *GetMail( unsigned long checksum ) { name_t *name;