isAChildOf doesn't work with relative paths

I'm still using JUCE 3, I just noticed that isAChildOf doesn't work when there are relative paths.

For example, the file:


isAChildOf returns false with this path:


What can I do?

Works here on JUCE 4.1.


int main()
    File f1 ("/Documents/Pictures/Album/../../file.png");
    File f2 ("/Documents/");

    std::cout << std::boolalpha << f1.isAChildOf (f2) << std::endl;



Please upgrade to the newest JUCE version and try again.

Thanks for your reply.

I updated to 4.1 but I'm still getting the same problem. My example was wrong, it should be more like this:

    File f1 ("/Documents/Album1/Subfolder/../../Album2/file.png");
    File f2 ("/Documents/Album2/");

result is false but should be true.

I don't think that isAChildOf actually resolves the relative path.

Hmm, ok, thanks. Yes, it doesn't check the path for ellipsis. I'll look into it..