aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTom Tromey <tromey@cygnus.com>1998-10-22 16:30:34 +0000
committerTom Tromey <tromey@gcc.gnu.org>1998-10-22 16:30:34 +0000
commit71f6a8e2e69c2e8625a18afa9318638e87a6197d (patch)
treec41434d35bb694b5425a55169cd7fc73f7d24062 /gcc
parentb18cfc286169fd26073ec1655f6a72d10fd6552d (diff)
downloadgcc-71f6a8e2e69c2e8625a18afa9318638e87a6197d.zip
gcc-71f6a8e2e69c2e8625a18afa9318638e87a6197d.tar.gz
gcc-71f6a8e2e69c2e8625a18afa9318638e87a6197d.tar.bz2
jcf-path.c (add_entry): Don't add trailing separator if entry is a .zip file.
* 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. From-SVN: r23229
Diffstat (limited to 'gcc')
-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 c117009..67da726 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 6e88496..829f99a 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 b425b8b..96debd0 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;
}