From 3fb96d8c0c18cf1c73a40a2c786d3ccd1449c7ba Mon Sep 17 00:00:00 2001 From: Doni Pracner Date: Sun, 30 Aug 2015 15:58:58 +0200 Subject: [PATCH] mjc2wsl, made more robust against empty arguments and such --- src/com/quemaster/transformations/mjc2wsl/mjc2wsl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/quemaster/transformations/mjc2wsl/mjc2wsl.java b/src/com/quemaster/transformations/mjc2wsl/mjc2wsl.java index 0620e37..e33cd09 100644 --- a/src/com/quemaster/transformations/mjc2wsl/mjc2wsl.java +++ b/src/com/quemaster/transformations/mjc2wsl/mjc2wsl.java @@ -806,7 +806,7 @@ public class mjc2wsl{ printHelp(); } else { int i = 0; - while (i < args.length && args[i].charAt(0) == '-') { + while (i < args.length && args[i].length() > 0 && args[i].charAt(0) == '-') { if (args[i].compareTo("-h") == 0) { printHelp(); return; @@ -870,7 +870,7 @@ public class mjc2wsl{ } Path p = FileSystems.getDefault().getPath(args[i]); - if (!Files.exists(p)){ + if (!Files.isRegularFile(p)){ System.err.println("input file does not exist"); System.exit(1); } -- 2.25.1