IDEA-107516 ("." and ".." are not a valid file names)

This commit is contained in:
Roman Shevchenko
2013-05-22 12:09:04 +02:00
parent 34118542ee
commit 8308cbb822
@@ -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 != '>';