diff options
Diffstat (limited to 'gcc/java/jcf-path.c')
-rw-r--r-- | gcc/java/jcf-path.c | 13 |
1 files changed, 6 insertions, 7 deletions
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; |