Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Root directory gets replaced by "." in Linux #205

Open
jvannugteren opened this issue Dec 9, 2024 · 3 comments
Open

Root directory gets replaced by "." in Linux #205

jvannugteren opened this issue Dec 9, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@jvannugteren
Copy link

I think this is a completely separate issue from the previous one, so I decided to file it separately. When I browse to the root directory "/" in Linux and then open the Places tab it calls the function std::string IGFD::FileManager::GetCurrentPath(). Which then replaces the active directory m_CurrentPath with a dot "." in line if (m_CurrentPath.empty()) m_CurrentPath = ".". This then breaks the filedialog because it cant open for example /mnt as it is actually trying to open ./mnt, which does not exist. Still figuring out if I can suggest how to solve this.

@jvannugteren
Copy link
Author

Ok found a solution. In the void IGFD::FileManager::SetCurrentDir(const std::string& vPath) the trailing slash gets removed and then it gets replaced with the "." in GetCurrentPath function. It should not do this when this is the root slash:

if (m_CurrentPath[m_CurrentPath.size() - 1] == PATH_SEP) {
if (m_CurrentPath.size()>1){
m_CurrentPath = m_CurrentPath.substr(0, m_CurrentPath.size() - 1);
}
}

@aiekick aiekick added the bug Something isn't working label Dec 10, 2024
@aiekick
Copy link
Owner

aiekick commented Dec 10, 2024

Hello, thanks for the issue.

same comment as for the other issue #204

@jvannugteren
Copy link
Author

Hi, totally understand. I'm using this temporary fix until you find time to fix it properly (maybe useful for others stumbling upon this issue).
fix-submodule.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants