mirror of https://github.com/quasar/Quasar.git
fix trailing forward-slash
This commit is contained in:
parent
81f45fdf8a
commit
93b87a7f62
|
@ -36,7 +36,10 @@ public FrmFileManager(Client c)
|
|||
private string GetAbsolutePath(string item)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_currentDir) && _currentDir[0] == '/')
|
||||
return Path.Combine(_currentDir, item + '/');
|
||||
if (_currentDir.Length == 1)
|
||||
return Path.Combine(_currentDir, item);
|
||||
else
|
||||
return Path.Combine(_currentDir + '/', item);
|
||||
|
||||
return Path.GetFullPath(Path.Combine(_currentDir, item));
|
||||
}
|
||||
|
@ -47,9 +50,13 @@ private void NavigateUp()
|
|||
{
|
||||
if (_currentDir.LastIndexOf('/') > 0)
|
||||
{
|
||||
_currentDir = _currentDir.Remove(_currentDir.LastIndexOf('/') + 1);
|
||||
_currentDir = _currentDir.TrimEnd('/');
|
||||
SetCurrentDir(_currentDir.Remove(_currentDir.LastIndexOf('/') + 1));
|
||||
}
|
||||
else
|
||||
_currentDir = "/";
|
||||
|
||||
SetCurrentDir(_currentDir);
|
||||
}
|
||||
else
|
||||
SetCurrentDir(GetAbsolutePath(@"..\"));
|
||||
|
|
Loading…
Reference in New Issue