mirror of
https://github.com/transmission/transmission
synced 2025-03-11 22:52:53 +00:00
re-tweak the previous commit based on feedback from kklimonda
This commit is contained in:
parent
2ea9f78eff
commit
0051b8a110
5 changed files with 13 additions and 12 deletions
|
@ -31,7 +31,7 @@
|
|||
#include "bencode.h"
|
||||
#include "json.h"
|
||||
#include "list.h"
|
||||
#include "platform.h" /* MAX_PATH_LEN */
|
||||
#include "platform.h" /* TR_PATH_MAX */
|
||||
#include "ptrarray.h"
|
||||
#include "utils.h" /* tr_new(), tr_free() */
|
||||
|
||||
|
@ -1621,7 +1621,7 @@ tr_bencToFile( const tr_benc * top, tr_fmt_mode mode, const char * filename )
|
|||
char * tmp;
|
||||
int fd;
|
||||
int err = 0;
|
||||
char buf[TR_MAX_PATH];
|
||||
char buf[TR_PATH_MAX];
|
||||
|
||||
/* follow symlinks to find the "real" file, to make sure the temporary
|
||||
* we build with mkstemp() is created on the right partition */
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
#include "transmission.h"
|
||||
#include "fdlimit.h"
|
||||
#include "net.h"
|
||||
#include "platform.h" /* TR_MAX_PATH, TR_PATH_DELIMITER */
|
||||
#include "platform.h" /* TR_PATH_MAX, TR_PATH_DELIMITER */
|
||||
#include "session.h"
|
||||
#include "torrent.h" /* tr_isTorrent() */
|
||||
#include "utils.h"
|
||||
|
@ -87,7 +87,7 @@ struct tr_openfile
|
|||
tr_bool isWritable;
|
||||
int torrentId;
|
||||
tr_file_index_t fileNum;
|
||||
char filename[TR_MAX_PATH];
|
||||
char filename[TR_PATH_MAX];
|
||||
int fd;
|
||||
uint64_t date;
|
||||
};
|
||||
|
|
|
@ -315,7 +315,7 @@ getFileInfo( const char * topFile,
|
|||
tr_bencInitList( uninitialized_path, n );
|
||||
for( prev = pch = file->filename + topLen; ; ++pch )
|
||||
{
|
||||
char buf[TR_MAX_PATH];
|
||||
char buf[TR_PATH_MAX];
|
||||
|
||||
if( *pch && *pch != TR_PATH_DELIMITER )
|
||||
continue;
|
||||
|
|
|
@ -440,7 +440,7 @@ tr_getDefaultConfigDir( const char * appname )
|
|||
SHGetFolderPath( NULL, CSIDL_APPDATA, NULL, 0, appdata );
|
||||
s = tr_buildPath( appdata, appname, NULL );
|
||||
#elif defined( __HAIKU__ )
|
||||
char buf[TR_MAX_PATH];
|
||||
char buf[TR_PATH_MAX];
|
||||
find_directory( B_USER_SETTINGS_DIRECTORY, -1, true, buf, sizeof(buf) );
|
||||
s = tr_buildPath( buf, appname, NULL );
|
||||
#else
|
||||
|
|
|
@ -27,13 +27,14 @@
|
|||
|
||||
#ifdef WIN32
|
||||
#include <windows.h> /* MAX_PATH */
|
||||
#define TR_PATH_MAX MAX_PATH
|
||||
#else
|
||||
#include <limits.h> /* MAX_PATH */
|
||||
#endif
|
||||
#ifdef MAX_PATH
|
||||
#define TR_MAX_PATH MAX_PATH
|
||||
#else
|
||||
#define TR_MAX_PATH 4096
|
||||
#include <limits.h> /* PATH_MAX */
|
||||
#ifdef PATH_MAX
|
||||
#define TR_PATH_MAX PATH_MAX
|
||||
#else
|
||||
#define TR_PATH_MAX 4096
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue