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 c6830a5..e33cd09 100644 (file)
@@ -40,7 +40,7 @@ import com.quemaster.transformations.TransMessages;
  */
 public class mjc2wsl{
        //default version name, used if the file is not found
-       private static String versionN = "0.1.x";
+       private static String versionN = "v0.2.x";
 
        private String versionFile = "/version.properties";
        
@@ -176,7 +176,7 @@ public class mjc2wsl{
        public String createStandardStart(int numWords){
                StringBuilder ret = new StringBuilder(
                        "C:\" This file automatically converted from microjava bytecode\";\n"
-                       +"C:\" with mjc2wsl "+getVersion()+"\";\n");
+                       +"C:\" with mjc2wsl "+getVersion()+"\";\n");
 
                ret.append("\nBEGIN");
                ret.append("\nVAR <\n\t");
@@ -790,7 +790,7 @@ public class mjc2wsl{
        }
 
        public void printVersion() {
-               System.out.println("MicroJava bytecode to WSL converter. v " + getVersion()
+               System.out.println("MicroJava bytecode to WSL converter " + getVersion()
                                + ", by Doni Pracner");
        }
        
@@ -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