Commit Graph

22 Commits

Author SHA1 Message Date
Daiki Ueno 0120f3d478 jartool.c (extract_jar): Don't lseek to skip extra fields.
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.

From-SVN: r62208
2003-01-31 22:48:27 +00:00
Ranjit Mathew b39864a90a jartool.c (list_jar): Terminate the 'ascii_date' buffer with a '\0' to guard against the case where...
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.

From-SVN: r61571
2003-01-21 20:53:31 +00:00
Zack Weinberg 4977bab6ed Merge basic-improvements-branch to trunk
From-SVN: r60174
2002-12-16 18:23:00 +00:00
Ranjit Mathew 7fe75c0324 jartool.c (extract_jar): Use "open" with O_BINARY instead of "creat" to create extracted files.
2002-11-21  Ranjit Mathew <rmathew@hotmail.com>

	* jartool.c (extract_jar): Use "open" with O_BINARY instead of
	"creat" to create extracted files.

From-SVN: r59366
2002-11-22 03:20:24 +00:00
Jakub Jelinek 9d8f417b41 jartool.c (add_to_jar): Only compare file to jarfile if jarfile is non-NULL.
* jartool.c (add_to_jar): Only compare file to jarfile if jarfile is
	non-NULL.

	* configure.in (AC_CHECK_HEADERS): Add limits.h.
	* configure, config.h.in: Rebuilt.

From-SVN: r58990
2002-11-10 22:04:24 +01:00
Tom Tromey 248cfd1c86 * jartool.c: Use mode 0666 when opening new file.
From-SVN: r58341
2002-10-20 23:30:24 +00:00
Tom Tromey 9251acb480 jartool.c (mkdir): Define.
* jartool.c (mkdir): Define.
	* config.h.in: Rebuilt.
	* aclocal.m4, configure: Rebuilt.
	* acinclude.m4: New file.  Copied gcc_AC_COMPILE_CHECK_SIZEOF,
	gcc_AC_EXAMINE_OBJECT, and fastjar_AC_COMPILE_C_BIGENDIAN from
	aclocal.m4.

From-SVN: r56983
2002-09-09 21:19:16 +00:00
Tom Tromey a038cc83d6 re PR java/7830 (Off-by-one buffer overruns in fastjar tool)
From greenrd@hotmail.com:
	* jartool.c (list_jar): Correctly determine when new `filename'
	buffer must be allocated.  Fixes PR java/7830.

From-SVN: r56818
2002-09-04 22:40:55 +00:00
Bryce McKinlay 38cb4e8407 jartool.c (expand_options): Handle tar-style argument list with a leading "-".
* jartool.c (expand_options): Handle tar-style argument list with a
	leading "-".

From-SVN: r50957
2002-03-18 11:08:21 +00:00
Anthony Green b9f8d427a8 jar -C fix
From-SVN: r50009
2002-02-24 19:59:46 +00:00
Tom Tromey 250fce1dfa jartool.c (main): NULL-terminate new_argv.
* jartool.c (main): NULL-terminate new_argv.  Pass 0 as argument
	to init_args.

From-SVN: r49351
2002-01-31 00:52:16 +00:00
Tom Tromey 7a93476d9b For PR libgcj/5303:
* jargrep.h: Removed RCS keywords.
	(GVERSION): Removed.
	* configure, Makefile.in, config.h.in: Rebuilt.
	* configure.in: Added AM_MAINTAINER_MODE.
	Don't look for getopt.h.  Use `fastjar' as package name.
	* Makefile.am (INCLUDES): Look in ../include.
	(LIBIBERTY): New macro.
	(jar_LDADD): Use it.
	(jar_DEPENDENCIES): Likewise.
	(grepjar_LDADD): Likewise.
	(grepjar_DEPENDENCIES): Likewise.
	* jargrep.c: Removed RCS keywords.  Always include getopt.h.
	(LONG_OPT): New macro.
	(OPT_HELP): Likewise.
	(main): Use getopt_long.  Let getopt print invalid argument
	message.  Handle --help.  Use version().
	(version): New function.
	(optarg, optind): Don't declare.
	(option_vec): New global.
	(help): New function.
	(Usage): Updated to GNU standards.
	* jartool.c: Removed RCS keywords.  Include getopt.h.
	(LONG_OPT): New macro.
	(OPT_HELP): Likewise.
	(options): New global.
	(help): New function.
	(usage): Print a single line.
	(version): New function.
	(expand_options): New function.
	(main): Use getopt_long and expand_options.  Fail if `-u'
	specified.  Changed handling of -f, -m, -V options.
	(OPTION_STRING): New macro.
	(version_string): Removed.

From-SVN: r48697
2002-01-09 23:22:20 +00:00
Craig Rodrigues 798010914e re PR bootstrap/5117 (irix6.5 bootstrap failure when using SGI's compiler)
2001-01-02  Craig Rodrigues  <rodrigc@gcc.gnu.org>

        PR bootstrap/5117
        * configure.in (AC_CHECK_HEADERS): Check for stdlib.h.
        * Makefile.am: Move grepjar to bin_PROGRAMS.
        * config.h.in: Regenerated.
        * Makefile.in: Regenerated.
        * aclocal.m4: Regenerated.
        * jargrep.c: Eliminate some signed/unsigned and default
        uninitialized warnings. Use HAVE_STDLIB_H instead of
        STDC_HEADERS macro.
        * jartool.c: Likewise.
        * compress.c: Likewise.

From-SVN: r48493
2002-01-03 04:57:56 +00:00
Bryce McKinlay ac43be7309 jatool.c (extract_jar): Account for null termination when determining whether to expand "filename".
* jatool.c (extract_jar): Account for null termination when
	determining whether to expand "filename".

From-SVN: r46220
2001-10-12 01:49:42 +01:00
Alexandre Petit-Bianco 51a25585ff re PR java/3949 (fastjar exits success if @file not found)
2001-08-28  Alexandre Petit-Bianco  <apbianco@redhat.com>

	* jartool.c (add_to_jar): Return 1 if `stat' initialy failed.
	Fixes PR java/3949.

(http://gcc.gnu.org/ml/gcc-patches/2001-08/msg01641.html)

From-SVN: r45250
2001-08-28 18:35:32 -07:00
Tom Tromey c5bb59c118 jartool.c (jarfile): Remove length limitation.
* jartool.c (jarfile): Remove length limitation.
	(main): Use jt_strdup when initializing jarfile.

From-SVN: r45217
2001-08-27 23:09:37 +00:00
Tom Tromey 72ea889aa5 Modified from patch by Julian Hall <jules@acris.co.uk>:
* jartool.c (errno): Conditionally declare.
	(O_BINARY): Conditionally define.
	(main): Use open, not creat.  Use O_BINARY everywhere.
	(make_manifest): Use O_BINARY.
	(add_to_jar): Likewise.

From-SVN: r43766
2001-07-04 18:33:53 +00:00
John David Anglin 0ee6e0a9ab jartool.c (jt_strdup): New function.
* jartool.c (jt_strdup): New function.
	(get_next_arg): Use jt_strdup instead of strdup.

From-SVN: r41815
2001-05-03 21:40:47 +00:00
Robert Lipe 347d73aac2 jartool.c (MAXPATHLEN): Provide if not defined.
2000-12-28  Robert Lipe <robertl@sco.com>

        * jartool.c (MAXPATHLEN): Provide if not defined.

From-SVN: r38515
2000-12-28 21:47:37 +00:00
Kaveh R. Ghazi 990bee10e7 Warning fixes:
* compress.c: Include stdlib.h and compress.h.
	(rcsid): Delete.
	(report_str_error): Make static.
	(ez_inflate_str): Delete unused variable.  Add parens in if-stmt.
	(hrd_inflate_str): Likewise.

	* compress.h (init_compression, end_compression, init_inflation,
	end_inflation): Prototype void arguments.

	* dostime.c (rcsid): Delete.

	* jargrep.c: Include ctype.h, stdlib.h, zlib.h and compress.h.
	Make functions static.  Cast ctype function argument to `unsigned
	char'.  Add parens in if-stmts.  Constify.
	(Usage): Change into a macro.
	(jargrep): Remove unused parameter.

	* jartool.c: Constify.  Add parens in if-stmts.  Align
	signed/unsigned char pointers in functions calls using casts.
	(rcsid): Delete.
	(list_jar): Fix printf format specifier.
	(usage): Chop long string into bits.  Reformat.

	* pushback.c (rcsid): Delete.

From-SVN: r38254
2000-12-14 18:45:35 +00:00
Tom Tromey b114d8ed2e * jartool.c (extract_jar): Use strchr, not index.
From-SVN: r38225
2000-12-13 18:11:57 +00:00
Alexandre Petit-Bianco bd8757b313 fastjar: Imported.
2000-12-08  Alexandre Petit-Bianco  <apbianco@cygnus.com>

        * fastjar: Imported.

From-SVN: r38145
2000-12-08 19:08:23 -08:00