mirror of
https://github.com/transmission/transmission
synced 2025-02-04 13:32:19 +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 <assert.h>
|
||||||
|
#include <ctype.h> /* isalpha */
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -195,7 +196,7 @@ tr_msg( const char * file, int line, int level, const char * fmt, ... )
|
||||||
{
|
{
|
||||||
FILE * fp;
|
FILE * fp;
|
||||||
|
|
||||||
assert( NULL != messageLock );
|
if( messageLock )
|
||||||
tr_lockLock( messageLock );
|
tr_lockLock( messageLock );
|
||||||
|
|
||||||
fp = tr_getLog( );
|
fp = tr_getLog( );
|
||||||
|
@ -243,6 +244,7 @@ tr_msg( const char * file, int line, int level, const char * fmt, ... )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( messageLock )
|
||||||
tr_lockUnlock( messageLock );
|
tr_lockUnlock( messageLock );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -407,6 +409,8 @@ tr_mkdir( const char * path, int permissions
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
if( path && isalpha(path[0]) && path[1]==':' && !path[2] )
|
||||||
|
return 0;
|
||||||
return mkdir( path );
|
return mkdir( path );
|
||||||
#else
|
#else
|
||||||
return mkdir( path, permissions );
|
return mkdir( path, permissions );
|
||||||
|
|
Loading…
Reference in a new issue