Forgot to add the separator to test

This commit is contained in:
Ruud
2014-06-24 10:09:34 +02:00
parent 7401201af2
commit 3941076c06
2 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -294,8 +294,8 @@ def dictIsSubset(a, b):
# Returns True if sub_folder is the same as or inside base_folder
def isSubFolder(sub_folder, base_folder):
if base_folder and sub_folder:
base = sp(os.path.realpath(base_folder))
subfolder = sp(os.path.realpath(sub_folder))
base = sp(os.path.realpath(base_folder)) + os.path.sep
subfolder = sp(os.path.realpath(sub_folder)) + os.path.sep
return os.path.commonprefix([subfolder, base]) == base
return False
+1
View File
@@ -82,6 +82,7 @@ class FileManager(Plugin):
def doSubfolderTest(self):
tests = {
('/test/subfolder', '/test/sub'): False,
('/test/sub/folder', '/test/sub'): True,
('/test/sub/folder', '/test/sub2'): False,
('/sub/fold', '/test/sub/fold'): False,