* src/vm/vm.c (vm_create): Only put .jar file into classpath. Fixes
authortwisti <none@none>
Mon, 13 Mar 2006 11:35:26 +0000 (11:35 +0000)
committertwisti <none@none>
Mon, 13 Mar 2006 11:35:26 +0000 (11:35 +0000)
startup bug with knopflerfish.

src/vm/vm.c

index e4148457ef7b6fddd48c875cc4bdda2db34c83a9..a63223b49bf54ad61e3a297aef2cc8d5b1f461c8 100644 (file)
@@ -958,31 +958,25 @@ bool vm_create(JavaVMInitArgs *vm_args)
        if (opt_index < vm_args->nOptions) {
                mainstring = vm_args->options[opt_index++].optionString;
 
-               if (opt_jar == true) {
+               /* Put the jar file into the classpath (if any). */
 
-                       /* prepend the jar file to the classpath (if any) */
+               if (opt_jar == true) {
+                       /* free old classpath */
 
-                       if (opt_jar == true) {
-                               /* put jarfile in classpath */
+                       MFREE(classpath, char, strlen(classpath));
 
-                               cp = classpath;
+                       /* put jarfile into classpath */
 
-                               classpath = MNEW(char, strlen(mainstring) + strlen(":") +
-                                                                strlen(classpath) + strlen("0"));
+                       classpath = MNEW(char, strlen(mainstring) + strlen("0"));
 
-                               strcpy(classpath, mainstring);
-                               strcat(classpath, ":");
-                               strcat(classpath, cp);
+                       strcpy(classpath, mainstring);
                
-                               MFREE(cp, char, strlen(cp));
+               } else {
+                       /* replace .'s with /'s in classname */
 
-                       } else {
-                               /* replace .'s with /'s in classname */
-
-                               for (i = strlen(mainstring) - 1; i >= 0; i--)
-                                       if (mainstring[i] == '.')
-                                               mainstring[i] = '/';
-                       }
+                       for (i = strlen(mainstring) - 1; i >= 0; i--)
+                               if (mainstring[i] == '.')
+                                       mainstring[i] = '/';
                }
        }