Skip to content

Commit

Permalink
8337481 Fix FileSystemJava.pathFileName
Browse files Browse the repository at this point in the history
  • Loading branch information
Schmidor committed Aug 29, 2024
1 parent b88ac04 commit 328f32b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ int readFromFile(PlatformFileHandle handle, void* data, int length)
return result;
}

String pathGetFileName(const String& path)
String pathFileName(const String& path)
{
JNIEnv* env = WTF::GetJavaEnv();

Expand Down Expand Up @@ -441,13 +441,6 @@ bool isHiddenFile(const String& path)
return false;
}

String pathFileName(const String& path)
{
UNUSED_PARAM(path);
// return path.substring(path.reverseFind('/') + 1);
return nullString();
}

bool hardLinkOrCopyFile(const String& targetPath, const String& linkPath)
{
fprintf(stderr, "hardLinkOrCopyFile(const String& targetPath, const String& linkPath) NOT IMPLEMENTED\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,7 @@ void File::computeNameAndContentType(const String& path, const String& nameOverr
}
#endif

#if !PLATFORM(JAVA)
effectiveName = nameOverride.isEmpty() ? FileSystem::pathFileName(path) : nameOverride;
#else
// Use simple path not from std::FileSystem
effectiveName = nameOverride.isEmpty() ? path : nameOverride;
#endif
size_t index = effectiveName.reverseFind('.');
if (index != notFound) {
callOnMainThreadAndWait([&effectiveContentType, &effectiveName, index] {
Expand Down

0 comments on commit 328f32b

Please sign in to comment.