Fix for Bug 352679 - QDir::cleanPath bug

Authored by claudiup on Sep 15 2015, 2:33 AM.



QDir::cleanPath does not seem to take into consideration symbolic links when converting file names containing pointing to a relative path.

For instance:
QDir::cleanpath(" /bin/../lib/gcc/x86_64-redhat-linux/5.1.1/../../../../include/c++/5.1.1") returns "/include/c++/5.1.1" but this is incorrect when /lib is a symbolic link pointing to /usr/lib (Fedora 22 has this problem). Use instead QFileInfo::.canonicalFilePath which seems to do the right thing.

Diff Detail

R32 KDevelop
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
claudiup updated this revision to Diff 874.Sep 15 2015, 2:33 AM
claudiup retitled this revision from to Fix for Bug 352679 - QDir::cleanPath bug.
claudiup updated this object.
claudiup edited the test plan for this revision. (Show Details)
claudiup added a reviewer: kfunk.
claudiup set the repository for this revision to R32 KDevelop.
claudiup added a project: KDevelop.
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptSep 15 2015, 2:33 AM
kfunk edited edge metadata.Sep 15 2015, 5:56 AM

Looks fine to me, although this means disk-access (resolving symlinks) for each include path.

Other opinions?

mwolff added a subscriber: mwolff.Sep 15 2015, 5:24 PM

as this is cached, it's fine to go in. I'm all for it!

What is the next step?

Do you have commit rights? Otherwise someone of us will commit this for you.

No I don't have commit right so please feel free to apply the patch. Thanks

This revision was automatically updated to reflect the committed changes.
mwolff added a comment.Oct 8 2015, 3:52 PM

thanks for the patch, I've pushed it now. sorry for the long delay!