replace FILE_MAXDIR + FILE_MAXFILE with FILE_MAX
This commit is contained in:
@@ -270,12 +270,12 @@ static void get_filename(int argc, char **argv, char *filename)
|
||||
|
||||
if (argc > 1) {
|
||||
if (BLI_exists(argv[argc-1])) {
|
||||
BLI_strncpy(filename, argv[argc-1], FILE_MAXDIR + FILE_MAXFILE);
|
||||
BLI_strncpy(filename, argv[argc-1], FILE_MAX);
|
||||
}
|
||||
if (::strncmp(argv[argc-1], "-psn_", 5)==0) {
|
||||
static char firstfilebuf[512];
|
||||
if (GHOST_HACK_getFirstFile(firstfilebuf)) {
|
||||
BLI_strncpy(filename, firstfilebuf, FILE_MAXDIR + FILE_MAXFILE);
|
||||
BLI_strncpy(filename, firstfilebuf, FILE_MAX);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -289,7 +289,7 @@ static void get_filename(int argc, char **argv, char *filename)
|
||||
//::printf("looking for file: %s\n", filename);
|
||||
|
||||
if (BLI_exists(gamefile))
|
||||
BLI_strncpy(filename, gamefile, FILE_MAXDIR + FILE_MAXFILE);
|
||||
BLI_strncpy(filename, gamefile, FILE_MAX);
|
||||
|
||||
delete [] gamefile;
|
||||
}
|
||||
@@ -298,7 +298,7 @@ static void get_filename(int argc, char **argv, char *filename)
|
||||
filename[0] = '\0';
|
||||
|
||||
if(argc > 1)
|
||||
BLI_strncpy(filename, argv[argc-1], FILE_MAXDIR + FILE_MAXFILE);
|
||||
BLI_strncpy(filename, argv[argc-1], FILE_MAX);
|
||||
#endif // !_APPLE
|
||||
}
|
||||
|
||||
@@ -737,8 +737,8 @@ int main(int argc, char** argv)
|
||||
STR_String exitstring = "";
|
||||
GPG_Application app(system);
|
||||
bool firstTimeRunning = true;
|
||||
char filename[FILE_MAXDIR + FILE_MAXFILE];
|
||||
char pathname[FILE_MAXDIR + FILE_MAXFILE];
|
||||
char filename[FILE_MAX];
|
||||
char pathname[FILE_MAX];
|
||||
char *titlename;
|
||||
|
||||
get_filename(argc_py_clamped, argv, filename);
|
||||
|
@@ -147,8 +147,8 @@ extern "C" {
|
||||
#ifdef WITH_PYTHON
|
||||
|
||||
static RAS_ICanvas* gp_Canvas = NULL;
|
||||
static char gp_GamePythonPath[FILE_MAXDIR + FILE_MAXFILE] = "";
|
||||
static char gp_GamePythonPathOrig[FILE_MAXDIR + FILE_MAXFILE] = ""; // not super happy about this, but we need to remember the first loaded file for the global/dict load save
|
||||
static char gp_GamePythonPath[FILE_MAX] = "";
|
||||
static char gp_GamePythonPathOrig[FILE_MAX] = ""; // not super happy about this, but we need to remember the first loaded file for the global/dict load save
|
||||
|
||||
static SCA_PythonKeyboard* gp_PythonKeyboard = NULL;
|
||||
static SCA_PythonMouse* gp_PythonMouse = NULL;
|
||||
@@ -237,13 +237,13 @@ The function also converts the directory separator to the local file system form
|
||||
|
||||
static PyObject* gPyExpandPath(PyObject*, PyObject* args)
|
||||
{
|
||||
char expanded[FILE_MAXDIR + FILE_MAXFILE];
|
||||
char expanded[FILE_MAX];
|
||||
char* filename;
|
||||
|
||||
if (!PyArg_ParseTuple(args,"s:ExpandPath",&filename))
|
||||
return NULL;
|
||||
|
||||
BLI_strncpy(expanded, filename, FILE_MAXDIR + FILE_MAXFILE);
|
||||
BLI_strncpy(expanded, filename, FILE_MAX);
|
||||
BLI_path_abs(expanded, gp_GamePythonPath);
|
||||
return PyUnicode_DecodeFSDefault(expanded);
|
||||
}
|
||||
@@ -496,7 +496,7 @@ static PyObject* gPyGetBlendFileList(PyObject*, PyObject* args)
|
||||
list = PyList_New(0);
|
||||
|
||||
if (searchpath) {
|
||||
BLI_strncpy(cpath, searchpath, FILE_MAXDIR + FILE_MAXFILE);
|
||||
BLI_strncpy(cpath, searchpath, FILE_MAX);
|
||||
BLI_path_abs(cpath, gp_GamePythonPath);
|
||||
} else {
|
||||
/* Get the dir only */
|
||||
@@ -1728,7 +1728,7 @@ static void backupPySysObjects(void)
|
||||
static void initPySysObjects__append(PyObject *sys_path, const char *filename)
|
||||
{
|
||||
PyObject *item;
|
||||
char expanded[FILE_MAXDIR + FILE_MAXFILE];
|
||||
char expanded[FILE_MAX];
|
||||
|
||||
BLI_split_dir_part(filename, expanded, sizeof(expanded)); /* get the dir part of filename only */
|
||||
BLI_path_abs(expanded, gp_GamePythonPath); /* filename from lib->filename is (always?) absolute, so this may not be needed but it wont hurt */
|
||||
|
Reference in New Issue
Block a user