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
[mjc2wsl.git] / src / com / quemaster / transformations / mjc2wsl / mjc2wsl.java
index 0620e37..e33cd09 100644 (file)
@@ -806,7 +806,7 @@ public class mjc2wsl{
                        printHelp();
                } else {
                        int i = 0;
                        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;
                                if (args[i].compareTo("-h") == 0) {
                                        printHelp();
                                        return;
@@ -870,7 +870,7 @@ public class mjc2wsl{
                        }
 
                        Path p = FileSystems.getDefault().getPath(args[i]);
                        }
 
                        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);
                        }
                                System.err.println("input file does not exist");
                                System.exit(1);
                        }
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner