-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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 bug with baseQDir in PathUtils.cpp #5689
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If `base` is `Absolute`, `baseQDir(base)` will point to the working directory. It will result in undefined behaviors. _Originally posted by @PhysSong in #5117 (comment) Opening for easier discussion, even this solution is flawed: > Better than before, but that may result in getting foo/bar for /foo/bar which will be interpreted as old-style relative path.
🤖 Hey, I'm @LmmsBot from github.com/lmms/bot and I made downloads for this pull request, click me to make them magically appear! 🎩
Linux
Windows
macOS🤖{"platform_name_to_artifacts": {"Linux": [{"artifact": {"title": {"title": "(AppImage)", "platform_name": "Linux"}, "link": {"link": "https://9096-15778896-gh.circle-artifacts.com/0/lmms-1.2.3-716%2Bg603c380-linux-x86_64.AppImage"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/9096?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}], "Windows": [{"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://9095-15778896-gh.circle-artifacts.com/0/lmms-1.2.3-716%2Bg603c3802c-mingw-win32.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/9095?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://9094-15778896-gh.circle-artifacts.com/0/lmms-1.2.3-716%2Bg603c3802c-mingw-win64.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/9094?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/2l02i3m96h2fkflh/artifacts/build/lmms-1.2.2-msvc2017-win32.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/35465119"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/23t3ckskfa1uh74w/artifacts/build/lmms-1.2.2-msvc2017-win64.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/35465119"}, {"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/075bosmpchupw970/artifacts/build/lmms-1.2.2-msvc2017-win32.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/35465120"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/hij011so77dagq7e/artifacts/build/lmms-1.2.2-msvc2017-win64.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/35465120"}], "macOS": [{"artifact": {"title": {"title": "", "platform_name": "macOS"}, "link": {"link": "https://9097-15778896-gh.circle-artifacts.com/0/lmms-1.2.3-716%2Bg603c3802c-mac10.13.dmg"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/9097?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}]}, "commit_sha": "603c3802c2795e90bb76b8ca5a05ccbe23a62615"} |
I think |
PhysSong
reviewed
Sep 29, 2020
LGTM |
Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>
Just realized the previous fix didn't do what I intended it to, whoops. |
PhysSong
approved these changes
Sep 30, 2020
sdasda7777
pushed a commit
to sdasda7777/lmms
that referenced
this pull request
Jun 28, 2022
* Fix relativeOrAbsolute bug with baseQDir in PathUtils.cpp If `base` is `Absolute`, `baseQDir(base)` will point to the working directory. It will result in undefined behaviors. To fix this, update relativeOrAbsolute to explicitly return an absolute path when the target base is Absolute. Also make baseQDir return QDir::root() for Absolute base instead of QDir(""), because the latter represents the working directory. Co-authored-by: Hyunjin Song <tteu.ingog@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Originally posted by @PhysSong in #5117 (comment):
If
base
isAbsolute
,baseQDir(base)
will point to the working directory. It will result in undefined behaviors.Opening for easier discussion, even this solution is flawed: