From 5b4f290c30a793aa2c4c94df2d142bc4db283bc1 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Wed, 27 Nov 2013 13:32:38 +0400 Subject: [PATCH] VfsUtilTest.testNotCanonicallyNamedChild under Linux --- .../intellij/openapi/vfs/newvfs/NewVirtualFileSystem.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/platform-api/src/com/intellij/openapi/vfs/newvfs/NewVirtualFileSystem.java b/platform/platform-api/src/com/intellij/openapi/vfs/newvfs/NewVirtualFileSystem.java index 5bde8f3f06cb..b6f84a59eb49 100644 --- a/platform/platform-api/src/com/intellij/openapi/vfs/newvfs/NewVirtualFileSystem.java +++ b/platform/platform-api/src/com/intellij/openapi/vfs/newvfs/NewVirtualFileSystem.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.io.File; import java.io.IOException; import java.util.HashMap; import java.util.Map; @@ -116,7 +117,8 @@ public abstract class NewVirtualFileSystem extends VirtualFileSystem implements } public String getCanonicallyCasedName(@NotNull VirtualFile file) { - return file.getName(); + // have to perform at least some canonicalization, e.g. remove multiple '///' + return new File(file.getPath()).getName(); } /**