From 045ac76af3c71f31525429fb08aebc3cffc5b70a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Nu=C8=9Biu?= Date: Thu, 9 Nov 2017 23:03:31 +0200 Subject: [PATCH] Fix: Preventing cd to . --- server/server/commands.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/server/commands.go b/server/server/commands.go index 66d6eda..b6227b0 100644 --- a/server/server/commands.go +++ b/server/server/commands.go @@ -119,7 +119,9 @@ func ChangeDirectoryCommand(c Client, directory string) error { return ErrStackCast } - if path == ".." { + if path == "." { + err = nil + } else if path == ".." { err = ChangeDirectoryToPrevious(stack) } else { err = ChangeDirectory(stack, path)