From 3bcb7e18ce8f579eea2417528b957a03f8c21be3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Thu, 29 Apr 2021 17:18:41 +0200 Subject: [PATCH] maybe this --- server/executor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/executor.py b/server/executor.py index 4586c5c..41ee405 100644 --- a/server/executor.py +++ b/server/executor.py @@ -34,7 +34,7 @@ class Executor: def setCurrentDirectory(self, dirName: str) -> str: if dirName == "..": - if self.currentDirectory == self.baseDir: + if self.currentDirectory == "": return self.currentDirectory else: directories = self.currentDirectory.split(os.path.sep) @@ -42,13 +42,13 @@ class Executor: for dir in directories: strdirectory += dir + os.path.sep strdirectory = strdirectory[:-3] - if os.path.exists(strdirectory): + if os.path.exists(os.path.join(self.baseDir, self.currentDirectory)): self.currentDirectory = strdirectory return self.currentDirectory else: dirName = self.sanitizeDirectory(dirName) - joinedDir = os.path.join(self.baseDir, self.currentDirectory, dirName) - if os.path.exists(joinedDir): + joinedDir = os.path.join(self.currentDirectory, dirName) + if os.path.join(self.baseDir, joinedDir): self.currentDirectory = joinedDir return self.currentDirectory