File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -652,8 +652,9 @@ std::shared_ptr<AndroidFileWrapper>
652652 }
653653
654654 std::optional<std::string> currentURI;
655- for (const auto & segment: pathSegments)
655+ for (auto it = pathSegments. begin (); it != pathSegments. end (); ++it )
656656 {
657+ const auto & segment = *it;
657658 LocalPath compositePath = pathCursor;
658659 compositePath.appendWithSeparator (LocalPath::fromRelativePath (segment), true );
659660
@@ -670,7 +671,9 @@ std::shared_ptr<AndroidFileWrapper>
670671 // Create intermediate path if necessary
671672 if (!nextWrapper || !nextWrapper->exists ())
672673 {
673- currentURI = currentWrapper->createOrReturnElement (segment, create, lastIsFolder);
674+ bool isLast = (std::next (it) == pathSegments.end ());
675+ currentURI =
676+ currentWrapper->createOrReturnElement (segment, create, !isLast || lastIsFolder);
674677
675678 if (!currentURI.has_value ())
676679 {
You can’t perform that action at this time.
0 commit comments