[Bf-blender-cvs] [5343d0f4940] master: Fix making paths relative on windows

Campbell Barton noreply at git.blender.org
Tue Feb 18 10:56:55 CET 2020


Commit: 5343d0f49400adf6515efcf5b2792edb532cd01c
Author: Campbell Barton
Date:   Tue Feb 18 20:47:43 2020 +1100
Branches: master
https://developer.blender.org/rB5343d0f49400adf6515efcf5b2792edb532cd01c

Fix making paths relative on windows

Comparing the drive letter was case sensitive,
causing 'BLI_path_rel' to fail in common cases
(manually entering a lower case drive letter for example).

Surprisingly this issue dates back to 2005 and wasn't reported.

===================================================================

M	source/blender/blenlib/intern/path_util.c

===================================================================

diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index f8e703dbb56..e3c455fe417 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -576,7 +576,7 @@ void BLI_path_rel(char *file, const char *relfile)
         }
       }
     }
-    else if (temp[1] == ':' && file[1] == ':' && temp[0] != file[0]) {
+    else if ((temp[1] == ':' && file[1] == ':') && (tolower(temp[0]) != tolower(file[0]))) {
       return;
     }
   }



More information about the Bf-blender-cvs mailing list