diff --git a/platform/util-rt/src/com/intellij/util/PathUtilRt.java b/platform/util-rt/src/com/intellij/util/PathUtilRt.java index 75e038fe01ec..7f413e37c9cb 100644 --- a/platform/util-rt/src/com/intellij/util/PathUtilRt.java +++ b/platform/util-rt/src/com/intellij/util/PathUtilRt.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. @@ -65,7 +65,7 @@ public class PathUtilRt { } public static boolean isValidFileName(@NotNull String fileName) { - if (fileName.length() == 0) { + if (fileName.length() == 0 || fileName.equals(".") || fileName.equals("..")) { return false; } for (int i = 0; i < fileName.length(); i++) { @@ -75,6 +75,7 @@ public class PathUtilRt { } return true; } + private static boolean isValidFileNameChar(char c) { return c != '/' && c != '\\' && c != '\t' && c != '\n' && c != '\r' && c != ':' && c != ';' && c != '*' && c != '?' && c != '"' && c != '\'' && c != '<' && c != '>';