From 128ee40d60db26ae17bf48a2c5555397b7ca49b7 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 3 Oct 2008 19:30:45 +0000 Subject: Small fix for (harmless) use of uninitialized memory. --- source/blender/blenlib/intern/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index 442a629b12d..9aba38b9bc2 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -1182,7 +1182,7 @@ int BLI_convertstringcode(char *path, const char *basepath) * Add a / prefix and lowercase the driveletter, remove the : * C:\foo.JPG -> /c/foo.JPG */ - if (tmp[1] == ':' && isalpha(tmp[0]) && (tmp[2]=='\\' || tmp[2]=='/') ) { + if (isalpha(tmp[0]) && tmp[1] == ':' && (tmp[2]=='\\' || tmp[2]=='/') ) { tmp[1] = tolower(tmp[0]); /* replace ':' with driveletter */ tmp[0] = '/'; /* '\' the slash will be converted later */ -- cgit v1.2.3 From c9634ce5b40cc4344b189b607949d54183a7a398 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 6 Oct 2008 08:02:35 +0000 Subject: fix for [#17560] Error in BPY_run_python_script any path starting with a '.' on win32 would be replaced with C:\ (or the default root) this was added rev 6568 so the file selector would replace "." with C:\. should be moved to fileselector but for now compare with "." rather then checking the first char. header_view3d.c - prop edit and render were aligning in curve edit mode. --- source/blender/blenlib/intern/util.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index 9aba38b9bc2..013b9e0bb1b 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -893,7 +893,10 @@ void BLI_cleanup_file(const char *relabase, char *dir) */ #ifdef WIN32 - if(dir[0]=='.') { /* happens for example in FILE_MAIN */ + + /* Note, this should really be moved to the file selector, + * since this function is used in many areas */ + if(strcmp(dir, ".")==0) { /* happens for example in FILE_MAIN */ get_default_root(dir); return; } -- cgit v1.2.3