gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
mjc2wsl, made more robust against empty arguments and such
authorDoni Pracner <quinnuendo@gmail.com>
Sun, 30 Aug 2015 13:58:58 +0000 (15:58 +0200)
committerDoni Pracner <quinnuendo@gmail.com>
Sun, 30 Aug 2015 13:58:58 +0000 (15:58 +0200)
src/com/quemaster/transformations/mjc2wsl/mjc2wsl.java

index 0620e377387d7a5f334881ec5faaf547e7ca8a8c..e33cd09288b72df2246b4cb030f264951033029b 100644 (file)
@@ -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);
                        }
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner