summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>1998-10-22 16:30:34 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>1998-10-22 16:30:34 +0000
commited1c0cd596bd87de7cc1f3b670534bfc8b00cabe (patch)
treec41434d35bb694b5425a55169cd7fc73f7d24062
parentcbd845cd8c2efbfbdea767070a9d203267dc761c (diff)
downloadgcc-ed1c0cd596bd87de7cc1f3b670534bfc8b00cabe.tar.gz
* jcf-path.c (add_entry): Don't add trailing separator if entry is
a .zip file. (add_path): Don't add trailing separator to non-empty path elements. * lang.c (lang_decode_option): Check for -fclasspath and -fCLASSPATH before examining other `-f' options. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23229 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/java/ChangeLog8
-rw-r--r--gcc/java/jcf-path.c13
-rw-r--r--gcc/java/lang.c41
3 files changed, 35 insertions, 27 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index c1170098dbd..67da7266974 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,5 +1,13 @@
1998-10-22 Tom Tromey <tromey@cygnus.com>
+ * jcf-path.c (add_entry): Don't add trailing separator if entry is
+ a .zip file.
+ (add_path): Don't add trailing separator to non-empty path
+ elements.
+
+ * lang.c (lang_decode_option): Check for -fclasspath and
+ -fCLASSPATH before examining other `-f' options.
+
* java-tree.h (finalize_identifier_node): Don't declare.
* class.c (make_class_data): Don't push "final" field.
* decl.c (init_decl_processing): Don't push "final" field.
diff --git a/gcc/java/jcf-path.c b/gcc/java/jcf-path.c
index 6e88496b549..829f99a1947 100644
--- a/gcc/java/jcf-path.c
+++ b/gcc/java/jcf-path.c
@@ -152,7 +152,9 @@ add_entry (entp, filename, is_system)
n->flags |= FLAG_SYSTEM;
}
- if (filename[len - 1] != '/' && filename[len - 1] != DIR_SEPARATOR)
+ if (! (n->flags & FLAG_ZIP)
+ && filename[len - 1] != '/'
+ && filename[len - 1] != DIR_SEPARATOR)
{
char *f2 = (char *) alloca (len + 1);
strcpy (f2, filename);
@@ -186,20 +188,17 @@ add_path (entp, cp, is_system)
{
if (! *endp || *endp == PATH_SEPARATOR)
{
- strncpy (buf, startp, endp - startp);
if (endp == startp)
{
buf[0] = '.';
buf[1] = DIR_SEPARATOR;
buf[2] = '\0';
}
- else if (endp[-1] != '/' && endp[1] != DIR_SEPARATOR)
+ else
{
- buf[endp - startp] = DIR_SEPARATOR;
- buf[endp - startp + 1] = '\0';
+ strncpy (buf, startp, endp - startp);
+ buf[endp - startp] = '\0';
}
- else
- buf[endp - startp] = '\0';
add_entry (entp, buf, is_system);
if (! *endp)
break;
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index b425b8b97c7..96debd01847 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -126,6 +126,27 @@ lang_decode_option (argc, argv)
char **argv;
{
char *p = argv[0];
+
+#define CLARG "-fclasspath="
+ if (strncmp (p, CLARG, sizeof (CLARG) - 1) == 0)
+ {
+ jcf_path_classpath_arg (p + sizeof (CLARG) - 1);
+ return 1;
+ }
+#undef CLARG
+#define CLARG "-fCLASSPATH="
+ else if (strncmp (p, CLARG, sizeof (CLARG) - 1) == 0)
+ {
+ jcf_path_CLASSPATH_arg (p + sizeof (CLARG) - 1);
+ return 1;
+ }
+#undef CLARG
+ else if (strncmp (p, "-I", 2) == 0)
+ {
+ jcf_path_include_arg (p + 2);
+ return 1;
+ }
+
if (p[0] == '-' && p[1] == 'f')
{
/* Some kind of -f option.
@@ -183,26 +204,6 @@ lang_decode_option (argc, argv)
return 1;
}
-#define CLARG "-fclasspath="
- if (strncmp (p, CLARG, sizeof (CLARG) - 1) == 0)
- {
- jcf_path_classpath_arg (p + sizeof (CLARG));
- return 1;
- }
-#undef CLARG
-#define CLARG "-fCLASSPATH="
- else if (strncmp (p, CLARG, sizeof (CLARG) - 1) == 0)
- {
- jcf_path_CLASSPATH_arg (p + sizeof (CLARG));
- return 1;
- }
-#undef CLARG
- else if (strncmp (p, "-I", 2) == 0)
- {
- jcf_path_include_arg (p + 2);
- return 1;
- }
-
return 0;
}