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

Fix a bug in Linux platform that corrupted directory names in the dumpDirectories function #36

Conversation

elementc
Copy link
Contributor

Figured out why console is broken on linux, the issue was inside the recurseDumpDirectories function.

Bug was in this source:

          if ( (basePath[dStrlen(basePath) - 1]) != '/')
        dSprintf(szPath, 1024, "%s%s", basePath, subPath);
          else
        dSprintf(szPath, 1024, "%s%s", basePath, &subPath[1]);

the whole snippet is supposed to cat basePath and subPath with a / in between them, but the else clause actually just cats basePath with subPath minus the first letter, which explains the corruption I saw in the the 32-bit build fix PR:

Module Manager: Failed to scan modules files in directory '/home/casey/Repos/Torque2D-1/editor/rojectManager'

Whole function was a bit repetitive and unclear, and whitespace was a little rough, so I went through and rewrote / reformatted it to be simpler and commented it thoroughly.

As usual, if you found this valuable, please consider applying the hacktoberfest-accepted label to the PR.

Thanks!

@greenfire27
Copy link
Collaborator

Thanks for finding it! We can finally load the "roject" manager!

@greenfire27 greenfire27 merged commit 96f8662 into TorqueGameEngines:development Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants