Forget environment CLASSPATH if one is given with -classpath like sun and
authortwisti <none@none>
Mon, 2 Aug 2004 22:33:03 +0000 (22:33 +0000)
committertwisti <none@none>
Mon, 2 Aug 2004 22:33:03 +0000 (22:33 +0000)
gcj do (thanks to motse). TODO: set some type of bootclasspath

main.c
src/cacao/cacao.c

diff --git a/main.c b/main.c
index 55aa056505f879992c919be580f38fe111ef4668..e3158d84a7dc58add7f2d4b4a4025024a155d2d6 100644 (file)
--- a/main.c
+++ b/main.c
@@ -37,7 +37,7 @@
      - Calling the class loader
      - Running the main method
 
-   $Id: main.c 1371 2004-08-01 21:55:39Z stefan $
+   $Id: main.c 1390 2004-08-02 22:33:03Z twisti $
 
 */
 
@@ -350,6 +350,7 @@ int main(int argc, char **argv)
 
        /************ Collect info from the environment ************************/
 
+       /* set an initial, minimal classpath */
        classpath = MNEW(u1, 2);
        strcpy(classpath, ".");
 
@@ -374,12 +375,12 @@ int main(int argc, char **argv)
                case OPT_IGNORE: break;
                        
                case OPT_CLASSPATH:
+                       /* forget old classpath and set the argument as new classpath */
                        classpath = MREALLOC(classpath,
                                                                 u1,
                                                                 strlen(classpath),
-                                                                strlen(classpath) + 1 + strlen(opt_arg) + 1);
-                       strcat(classpath, ":");
-                       strncat(classpath, opt_arg, strlen(opt_arg));
+                                                                strlen(opt_arg) + 1);
+                       strncpy(classpath, opt_arg, strlen(opt_arg));
                        break;
                                
                case OPT_D:
index 4290c34f79fe8edcb422bcedd236dff1c1ecadf5..1bc66028c6e3b0545eea4923ee3845567f1c9519 100644 (file)
@@ -37,7 +37,7 @@
      - Calling the class loader
      - Running the main method
 
-   $Id: cacao.c 1371 2004-08-01 21:55:39Z stefan $
+   $Id: cacao.c 1390 2004-08-02 22:33:03Z twisti $
 
 */
 
@@ -350,6 +350,7 @@ int main(int argc, char **argv)
 
        /************ Collect info from the environment ************************/
 
+       /* set an initial, minimal classpath */
        classpath = MNEW(u1, 2);
        strcpy(classpath, ".");
 
@@ -374,12 +375,12 @@ int main(int argc, char **argv)
                case OPT_IGNORE: break;
                        
                case OPT_CLASSPATH:
+                       /* forget old classpath and set the argument as new classpath */
                        classpath = MREALLOC(classpath,
                                                                 u1,
                                                                 strlen(classpath),
-                                                                strlen(classpath) + 1 + strlen(opt_arg) + 1);
-                       strcat(classpath, ":");
-                       strncat(classpath, opt_arg, strlen(opt_arg));
+                                                                strlen(opt_arg) + 1);
+                       strncpy(classpath, opt_arg, strlen(opt_arg));
                        break;
                                
                case OPT_D: