mirror of
https://github.com/transmission/transmission
synced 2025-02-04 05:22:40 +00:00
make tr_mkdir() handle windows root directory paths like "C:"
This commit is contained in:
parent
0ee2fd6d3b
commit
608581ea80
1 changed files with 7 additions and 3 deletions
|
@ -23,6 +23,7 @@
|
|||
*****************************************************************************/
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h> /* isalpha */
|
||||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
@ -195,8 +196,8 @@ tr_msg( const char * file, int line, int level, const char * fmt, ... )
|
|||
{
|
||||
FILE * fp;
|
||||
|
||||
assert( NULL != messageLock );
|
||||
tr_lockLock( messageLock );
|
||||
if( messageLock )
|
||||
tr_lockLock( messageLock );
|
||||
|
||||
fp = tr_getLog( );
|
||||
|
||||
|
@ -243,7 +244,8 @@ tr_msg( const char * file, int line, int level, const char * fmt, ... )
|
|||
}
|
||||
}
|
||||
|
||||
tr_lockUnlock( messageLock );
|
||||
if( messageLock )
|
||||
tr_lockUnlock( messageLock );
|
||||
}
|
||||
|
||||
int tr_rand( int sup )
|
||||
|
@ -407,6 +409,8 @@ tr_mkdir( const char * path, int permissions
|
|||
)
|
||||
{
|
||||
#ifdef WIN32
|
||||
if( path && isalpha(path[0]) && path[1]==':' && !path[2] )
|
||||
return 0;
|
||||
return mkdir( path );
|
||||
#else
|
||||
return mkdir( path, permissions );
|
||||
|
|
Loading…
Reference in a new issue