[kaffe] CVS kaffe (guilhem): Fix for "-classpath" semantic of kaffe-bin.

Kaffe CVS cvs-commits at kaffe.org
Fri Jun 24 06:07:51 PDT 2005


PatchSet 6662 
Date: 2005/06/24 13:02:24
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
Fix for "-classpath" semantic of kaffe-bin.

        * kaffe/kaffe/main.c
        (options): "-classpath" must reset the classpath to the only specified
        by the following argument.

        Fixes bug reported by Daniel Bonniot <Daniel.Bonniot at inria.fr>

Members: 
	ChangeLog:1.4187->1.4188 
	kaffe/kaffe/main.c:1.85->1.86 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4187 kaffe/ChangeLog:1.4188
--- kaffe/ChangeLog:1.4187	Thu Jun 23 16:52:42 2005
+++ kaffe/ChangeLog	Fri Jun 24 13:02:24 2005
@@ -1,3 +1,11 @@
+2005-06-24  Guilhem Lavaux  <guilhem at kaffe.org>
+
+	* kaffe/kaffe/main.c
+	(options): "-classpath" must reset the classpath to the only specified
+	by the following argument.
+
+	Fixes bug reported by Daniel Bonniot <Daniel.Bonniot at inria.fr>
+
 2005-06-23  Guilhem Lavaux  <guilhem at kaffe.org>
 
 	* kaffe/kaffevm/soft.c
Index: kaffe/kaffe/kaffe/main.c
diff -u kaffe/kaffe/kaffe/main.c:1.85 kaffe/kaffe/kaffe/main.c:1.86
--- kaffe/kaffe/kaffe/main.c:1.85	Mon May 30 21:16:02 2005
+++ kaffe/kaffe/kaffe/main.c	Fri Jun 24 13:02:28 2005
@@ -480,9 +480,21 @@
 			/* FIXME: skip, case handled by the calle script */
 		}
 #endif
-		else if ((strcmp(argv[i], "-addclasspath") == 0)
-			 || (strcmp(argv[i], "-classpath") == 0)
-			 || (strcmp(argv[i], "-cp") == 0)) {
+		else if (strcmp(argv[i], "-classpath") == 0
+			 || strcmp(argv[i], "-cp") == 0) {
+
+			i++;
+			if (argv[i] == 0) {
+				fprintf(stderr, 
+				    "Error: No path found for %s option.\n",
+				    argv[i - 1]);
+				exit(1);
+			}
+
+			/* set the new classpath */
+			vmargs.classpath = strdup(argv[i]);
+		}
+		else if (strcmp(argv[i], "-addclasspath") == 0) {
 			char	*newcpath;
 			unsigned int      cpathlength;
 




More information about the kaffe mailing list