From 1c91d62c7e682c72173750e88505ba08f6fabcdf Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 8 Mar 2012 02:19:41 +0000 Subject: [PATCH] use BLI_path_cmp() rather then strcmp() --- source/blender/blenkernel/intern/dynamicpaint.c | 4 ++-- source/blender/blenkernel/intern/image.c | 4 ++-- source/blender/python/intern/bpy_traceback.c | 8 +++++--- source/tests/bl_run_operators.py | 3 +++ 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index 4830d7ed61e..5bc3b958f2e 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -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; diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 22e9d1ccf4b..3ac95b83e74 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -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; } } diff --git a/source/blender/python/intern/bpy_traceback.c b/source/blender/python/intern/bpy_traceback.c index e3272c9da1a..84d1fdd45eb 100644 --- a/source/blender/python/intern/bpy_traceback.c +++ b/source/blender/python/intern/bpy_traceback.c @@ -29,6 +29,8 @@ #include #include +#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) { diff --git a/source/tests/bl_run_operators.py b/source/tests/bl_run_operators.py index 08e9d5d59e4..658a6849320 100644 --- a/source/tests/bl_run_operators.py +++ b/source/tests/bl_run_operators.py @@ -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 )