aboutsummaryrefslogtreecommitdiff
path: root/fastjar
diff options
context:
space:
mode:
authordnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-02-03 17:10:00 +0000
committerdnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2003-02-03 17:10:00 +0000
commitcdd25971bbe304b6bc3690f6b307c746e36aeb48 (patch)
tree58762dfad300d7a3f22d2d5f3e5fa65480253419 /fastjar
parent242b82fb37800b65dbb0ce6c2afa442f0ee1b856 (diff)
Mainline merge as of 2003-02-03. Needed to make some changes to
adapt the branch to -Werror: ChangeLog.tree-ssa 2003-02-03 Diego Novillo <dnovillo@redhat.com> Fix warnings to allow bootstrapping with -Werror. * Makefile.in (c-semantics.o-warn): Add -Wno-error. (emit-rtl.o-warn): Likewise. (profile.o-warn): Likewise. (tree.o-warn): Likewise. (OBJS): Remove simple-break-elim.o and simple-goto-elim.o. * c-pretty-print.c (print_function_decl): Remove unused function. * bitmap.c (bitmap_last_set_bit): Initialize variable 'word'. * c-typeck.c (build_binary_op): Initialize variable 'type'. * combine.c (combine_simplify_rtx): Initialize variable 'reversed'. (make_compound_operation): Initialize variable 'i'. * dwarf2out.c (dwarf2out_finish): Initialize variable 'context'. * expr.c (store_constructor): Initialize variables 'lo', 'hi', 'startb' and 'endb'. (expand_expr): Initialize variable 'op0'. * fold-const.c (fold): Initialize variable 'tem'. * profile.c (branch_prob): Initialize variable 'prev_file_name'. * reload.c (find_equiv_reg): Initialize variables 'valtry and 'valueno'. * rtlanal.c (get_jump_table_offset): Initialize variable 'set'. * ssa-ccp.c (ssa_const_prop): Fix sign mismatch warning. * varasm.c (output_constant_def): Initialize variable 'defstr'. * gimplify.c (simplify_expr): Initialize variables 'saved_input_filename' and 'saved_lineno'. (simplify_compound_lval): Initialize variable 'code'. * tree-alias-ander.c (pta_bottom): De-ansify. (andersen_cleanup): Remove unused variables. (andersen_heap_assign): Mark argument lhs ATTRIBUTE_UNUSED. (pta_bottom): Remove unused function. (pta_get_ptsize): Remove unused function. cp/ChangeLog.tree-ssa 2003-02-03 Diego Novillo <dnovillo@redhat.com> * parser.c (cp_parser_asm_definition): Call finish_asm_stmt with 'volatile_p' directly. * typeck.c (build_binary_op): Initialize variable 'type'. * Make-lang.in (cp/tree.o-warn): Add -Wno-error. java/ChangeLog.tree-ssa 2003-02-03 Diego Novillo <dnovillo@redhat.com> * parse.y (qualify_ambiguous_name): Initialize variable 'decl'. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/tree-ssa-20020619-branch@62325 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'fastjar')
-rw-r--r--fastjar/ChangeLog16
-rw-r--r--fastjar/jargrep.c6
-rw-r--r--fastjar/jartool.c20
3 files changed, 32 insertions, 10 deletions
diff --git a/fastjar/ChangeLog b/fastjar/ChangeLog
index 7fdadd228aa..8cd13466b63 100644
--- a/fastjar/ChangeLog
+++ b/fastjar/ChangeLog
@@ -1,3 +1,19 @@
+2003-01-31 Daiki Ueno <ueno@unixuser.org>
+
+ * jartool.c (extract_jar): Don't lseek to skip extra fields.
+ (consume): If the stream is seekable, do lseek.
+
+2003-01-28 Ranjit Mathew <rmathew@hotmail.com>
+
+ * jargrep.c: Include xregex.h from libiberty instead of
+ system regex.h for better portability.
+
+2003-01-21 Ranjit Mathew <rmathew@hotmail.com>
+
+ * jartool.c (list_jar): Terminate the 'ascii_date' buffer
+ with a '\0' to guard against the case where the formatted
+ time string is more than the size allowed by the buffer.
+
2003-01-14 Tom Tromey <tromey@redhat.com>
* config.h.in: Rebuilt.
diff --git a/fastjar/jargrep.c b/fastjar/jargrep.c
index 01c04500c5b..f879aee4e46 100644
--- a/fastjar/jargrep.c
+++ b/fastjar/jargrep.c
@@ -1,6 +1,6 @@
/*
jargrep.c - main functions for jargrep utility
- Copyright (C) 2002 Free Software Foundation
+ Copyright (C) 2002, 2003 Free Software Foundation
Copyright (C) 1999, 2000 Bryan Burns
Copyright (C) 2000 Cory Hollingsworth
@@ -105,7 +105,6 @@ will test some other platforms later.
#include "config.h"
#include <stdio.h>
#include <unistd.h>
-#include <regex.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
@@ -115,6 +114,9 @@ will test some other platforms later.
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
+
+#include "xregex.h"
+
#include "jargrep.h"
#include "jartool.h"
#include "pushback.h"
diff --git a/fastjar/jartool.c b/fastjar/jartool.c
index dcca13d1c5e..aacf765f21d 100644
--- a/fastjar/jartool.c
+++ b/fastjar/jartool.c
@@ -1465,9 +1465,6 @@ int extract_jar(int fd, char **files, int file_num){
}
if(method == 8 || flags & 0x0008){
- if(seekable)
- lseek(fd, eflen, SEEK_CUR);
- else
consume(&pbf, eflen);
inflate_file(&pbf, f_fd, &ze);
@@ -1502,9 +1499,6 @@ int extract_jar(int fd, char **files, int file_num){
#endif
}
- if(seekable)
- lseek(fd, eflen, SEEK_CUR);
- else
consume(&pbf, eflen);
}
@@ -1564,7 +1558,7 @@ int list_jar(int fd, char **files, int file_num){
int i, j;
time_t tdate;
struct tm *s_tm;
- char ascii_date[30];
+ char ascii_date[31];
zipentry ze;
#ifdef DEBUG
@@ -1655,6 +1649,7 @@ int list_jar(int fd, char **files, int file_num){
tdate = dos2unixtime(mdate);
s_tm = localtime(&tdate);
strftime(ascii_date, 30, "%a %b %d %H:%M:%S %Z %Y", s_tm);
+ ascii_date[30] = '\0';
}
if(filename_len < fnlen + 1){
@@ -1781,6 +1776,7 @@ int list_jar(int fd, char **files, int file_num){
free(filename);
filename = malloc(sizeof(ub1) * (fnlen + 1));
+ ascii_date[30] = '\0';
filename_len = fnlen + 1;
}
@@ -1847,6 +1843,14 @@ int consume(pb_file *pbf, int amt){
printf("Consuming %d bytes\n", amt);
#endif
+ if (seekable){
+ if (amt <= (int)pbf->buff_amt)
+ pb_read(pbf, buff, amt);
+ else {
+ lseek(pbf->fd, amt - pbf->buff_amt, SEEK_CUR);
+ pb_read(pbf, buff, pbf->buff_amt); /* clear pbf */
+ }
+ } else
while(tc < amt){
rdamt = pb_read(pbf, buff, ((amt - tc) < RDSZ ? (amt - tc) : RDSZ));
#ifdef DEBUG
@@ -1856,7 +1860,7 @@ int consume(pb_file *pbf, int amt){
}
#ifdef DEBUG
- printf("%d bytes consumed\n", tc);
+ printf("%d bytes consumed\n", amt);
#endif
return 0;