Prevent launching in path that contains !

This commit is contained in:
huangyuhui 2017-10-31 19:31:22 +08:00
parent ca627b8a2d
commit fabb6b50b4
2 changed files with 6 additions and 1 deletions

View File

@ -101,6 +101,11 @@ public final class Main {
public static void main(String[] args) throws IOException {
{
if (new File("").getAbsolutePath().contains("!")) {
MessageBox.show("HMCL cannot run at such path that contains '!'");
return;
}
try {
File file = new File("hmcl.log").getAbsoluteFile();
if (!file.exists() && !file.createNewFile())

View File

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see {http://www.gnu.org/licenses/}.
*/
rootProject.name = 'Hello Minecraft!'
rootProject.name = 'Hello Minecraft'
// Find the directories containing a "build.gradle" file in the root directory
// of the project. That is, every directory containing a "build.gradle" will