From 047d07f3766fee4fc3189e7cb37a32d206ca8d53 Mon Sep 17 00:00:00 2001 From: morkt Date: Wed, 2 Sep 2015 04:12:38 +0400 Subject: [PATCH] (FileSystemStack.ChDir): directory traversal fixes. --- GameRes/FileSystem.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/GameRes/FileSystem.cs b/GameRes/FileSystem.cs index abe22b55..c6728249 100644 --- a/GameRes/FileSystem.cs +++ b/GameRes/FileSystem.cs @@ -422,6 +422,10 @@ namespace GameRes if (Count > 1 && ".." == entry.Name && string.IsNullOrEmpty (Top.CurrentDirectory)) { Pop(); + if (!string.IsNullOrEmpty (LastVisitedPath)) + { + Top.CurrentDirectory = Path.GetDirectoryName (LastVisitedPath); + } } else {