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

Use Canonical Paths for Relative Paths Calculations #4211

Merged
merged 3 commits into from Mar 4, 2018

Conversation

Projects
None yet
2 participants
@tresf
Copy link
Member

tresf commented Mar 3, 2018

Forces strange paths like /path/.///to/../from/foo///// to be /path/from/foo.

Closes #4173

@@ -40,8 +40,10 @@ private slots:

QString absPath = fi.absoluteFilePath();
QString relPath = "drums/kick01.ogg";
QString fuzPath = absPath.replace(relPath, "drums/.///kick01.ogg");

This comment has been minimized.

@PhysSong

PhysSong Mar 4, 2018

Member

Current one won't work because this line modifies absPath. This one will work:

QString fuzPath = absPath;
fuzPath.replace(relPath, "drums/.///kick01.ogg");

This comment has been minimized.

@tresf

tresf Mar 4, 2018

Author Member

Ah yes, forgot Strings are mutable in Qt. Thanks.

Clone QString before fuzzing
QString are mutable objects.  Call replace on the clone, not on the original.

@tresf tresf merged commit 1d63bd3 into LMMS:stable-1.2 Mar 4, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@tresf tresf deleted the tresf:relative branch Mar 4, 2018

@tresf tresf restored the tresf:relative branch Mar 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.