forked from bartvdbraak/blender
use BLI_path_cmp() rather then strcmp()
This commit is contained in:
parent
6029640bca
commit
1c91d62c7e
@ -313,8 +313,8 @@ static int surface_duplicateOutputExists(void *arg, const char *name)
|
||||
for(; surface; surface=surface->next) {
|
||||
if (surface!=t_surface && surface->type==t_surface->type &&
|
||||
surface->format==t_surface->format) {
|
||||
if (surface->output_name[0]!='\0' && !strcmp(name, surface->output_name)) return 1;
|
||||
if (surface->output_name2[0]!='\0' && !strcmp(name, surface->output_name2)) return 1;
|
||||
if (surface->output_name[0]!='\0' && !BLI_path_cmp(name, surface->output_name)) return 1;
|
||||
if (surface->output_name2[0]!='\0' && !BLI_path_cmp(name, surface->output_name2)) return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -531,13 +531,13 @@ Image *BKE_add_image_file(const char *name)
|
||||
BLI_strncpy(strtest, ima->name, sizeof(ima->name));
|
||||
BLI_path_abs(strtest, G.main->name);
|
||||
|
||||
if( strcmp(strtest, str)==0 ) {
|
||||
if (BLI_path_cmp(strtest, str)==0) {
|
||||
if(ima->anim==NULL || ima->id.us==0) {
|
||||
BLI_strncpy(ima->name, name, sizeof(ima->name)); /* for stringcode */
|
||||
ima->id.us++; /* officially should not, it doesn't link here! */
|
||||
if(ima->ok==0)
|
||||
ima->ok= IMA_OK;
|
||||
/* RETURN! */
|
||||
/* RETURN! */
|
||||
return ima;
|
||||
}
|
||||
}
|
||||
|
@ -29,6 +29,8 @@
|
||||
#include <Python.h>
|
||||
#include <frameobject.h>
|
||||
|
||||
#include "BLI_path_util.h"
|
||||
|
||||
#include "bpy_traceback.h"
|
||||
|
||||
static const char *traceback_filepath(PyTracebackObject *tb, PyObject **coerce)
|
||||
@ -127,8 +129,8 @@ void python_script_error_jump(const char *filepath, int *lineno, int *offset)
|
||||
|
||||
if (parse_syntax_error(value, &message, &filename, lineno, offset, &text)) {
|
||||
/* python adds a '/', prefix, so check for both */
|
||||
if ((strcmp(filename, filepath) == 0) ||
|
||||
((filename[0] == '\\' || filename[0] == '/') && strcmp(filename + 1, filepath) == 0)
|
||||
if ((BLI_path_cmp(filename, filepath) == 0) ||
|
||||
((filename[0] == '\\' || filename[0] == '/') && BLI_path_cmp(filename + 1, filepath) == 0)
|
||||
) {
|
||||
/* good */
|
||||
}
|
||||
@ -152,7 +154,7 @@ void python_script_error_jump(const char *filepath, int *lineno, int *offset)
|
||||
{
|
||||
PyObject *coerce;
|
||||
const char *tb_filepath = traceback_filepath(tb, &coerce);
|
||||
const int match = strcmp(tb_filepath, filepath) != 0;
|
||||
const int match = BLI_path_cmp(tb_filepath, filepath) != 0;
|
||||
Py_DECREF(coerce);
|
||||
|
||||
if (match) {
|
||||
|
@ -42,6 +42,9 @@ op_blacklist = (
|
||||
"wm.doc_view",
|
||||
"wm.path_open",
|
||||
"help.operator_cheat_sheet",
|
||||
"wm.keyconfig_test", # just annoying - but harmless
|
||||
"wm.memory_statistics", # another annoying one
|
||||
# "mesh.vertex_color_remove", #crashes! fixme
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user