From: Doni Pracner Date: Sun, 30 Aug 2015 13:58:58 +0000 (+0200) Subject: mjc2wsl, made more robust against empty arguments and such X-Git-Tag: v0.2.1~13 X-Git-Url: https://svarog.pmf.uns.ac.rs/gitweb/?a=commitdiff_plain;h=3fb96d8c0c18cf1c73a40a2c786d3ccd1449c7ba;p=mjc2wsl.git mjc2wsl, made more robust against empty arguments and such --- 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); }