aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/jcf-path.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@cygnus.com>1998-11-12 11:43:19 +0000
committerTom Tromey <tromey@cygnus.com>1998-11-12 11:43:19 +0000
commitd3250883b11889feb02b88fc6c149cb1c769e21d (patch)
treed52233da6156ebaa9797083f8e59e615bba76a63 /gcc/java/jcf-path.c
parentb6fd410aff009a5a7abeb975e064a47e1e9cf029 (diff)
* jcf-io.c (find_class): Added explanatory comment.
* jcf-path.c (add_entry): Look for `.zip' at end of filename. Add trailing slash to `.zip' entries. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@23615 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/jcf-path.c')
-rw-r--r--gcc/java/jcf-path.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/java/jcf-path.c b/gcc/java/jcf-path.c
index 829f99a1947..159b09f9f71 100644
--- a/gcc/java/jcf-path.c
+++ b/gcc/java/jcf-path.c
@@ -141,7 +141,7 @@ add_entry (entp, filename, is_system)
n->next = NULL;
len = strlen (filename);
- if (len > 4 && ! strcmp (filename - 4, ".zip"))
+ if (len > 4 && ! strcmp (filename + len - 4, ".zip"))
{
n->flags |= FLAG_ZIP;
/* If the user uses -classpath then he'll have to include
@@ -152,9 +152,10 @@ add_entry (entp, filename, is_system)
n->flags |= FLAG_SYSTEM;
}
- if (! (n->flags & FLAG_ZIP)
- && filename[len - 1] != '/'
- && filename[len - 1] != DIR_SEPARATOR)
+ /* Note that we add a trailing separator to `.zip' names as well.
+ This is a little hack that lets the searching code in jcf-io.c
+ work more easily. Eww. */
+ if (filename[len - 1] != '/' && filename[len - 1] != DIR_SEPARATOR)
{
char *f2 = (char *) alloca (len + 1);
strcpy (f2, filename);