This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: gij support for slashes in class names


Hi,

gij does not support slashes in class name arguments. This patch adds support for this syntax, which is convenient when using command-line completion.

OK to commit?

Tom

2006-05-30 Thomas Fitzsimmons <fitzsim@redhat.com>

	* gij.cc (main): Convert slashes in class name specification to
	dots.
Index: gij.cc
===================================================================
--- gij.cc	(revision 114247)
+++ gij.cc	(working copy)
@@ -370,6 +370,17 @@
       sprintf (darg, "-Djava.class.path=%s", argv[i]);
       add_option (vm_args, darg, NULL);
     }
+  else
+    {
+      // Handle slashes in class names.
+      int name_length = strlen (argv[i]);
+      for (int c = 0; c < name_length; c++)
+        {
+          char* arg = (char*) argv[i];
+          if (arg[c] == '/')
+            arg[c] = '.';
+        }
+    }
 
   _Jv_RunMain (&vm_args, NULL, argv[i], argc - i,
                (char const**) (argv + i), jar_mode);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]