Przeglądaj źródła

FIX: Bug [0001797] executing "cd" to change cwd does not work up the tree

Alexander Koblov 8 lat temu
rodzic
commit
84d5738ef1
1 zmienionych plików z 11 dodań i 0 usunięć
  1. 11 0
      src/fmain.pas

+ 11 - 0
src/fmain.pas

@@ -5191,6 +5191,17 @@ begin
             begin
               sDir:= RemoveQuotation(Copy(sCmd, iIndex + 3, Length(sCmd)));
               sDir:= NormalizePathDelimiters(Trim(sDir));
+
+              if (sDir = DirectorySeparator) or (sDir = '..') then
+              begin
+                if (sDir = DirectorySeparator) then
+                  Commands.DoChangeDirToRoot(ActiveFrame)
+                else begin
+                  ActiveFrame.ChangePathToParent(True);
+                end;
+                Exit;
+              end;
+
               sDir:= ReplaceTilde(sDir);
               sDir:= GetAbsoluteFileName(ActiveFrame.CurrentPath, sDir);
               if mbFileExists(sDir) then //if user entered an existing file, let's switch to the parent folder AND select that file