diff options
author | Jörg Mayer <jmayer@loplof.de> | 2004-03-03 22:14:10 +0000 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2004-03-03 22:14:10 +0000 |
commit | 76ff7e4a66cc2e45a25a3ac815e5520195ea3ae4 (patch) | |
tree | 74d3769106d3b5d2ddb8671d27ecd9c6d87033e4 | |
parent | 84b5bd1e1d7ab4a4ebf1bfedeaf523d672ead6b6 (diff) | |
download | wireshark-76ff7e4a66cc2e45a25a3ac815e5520195ea3ae4.tar.gz wireshark-76ff7e4a66cc2e45a25a3ac815e5520195ea3ae4.tar.bz2 wireshark-76ff7e4a66cc2e45a25a3ac815e5520195ea3ae4.zip |
Bill Guyton: mergecap can write to stdout by using the special filename -
svn path=/trunk/; revision=10289
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | doc/mergecap.pod | 5 | ||||
-rw-r--r-- | mergecap.c | 7 |
3 files changed, 10 insertions, 3 deletions
@@ -2082,6 +2082,7 @@ And assorted fixes and enhancements by the people listed above and by: Magnus Hansson <mah [AT] hms.se> Pavel Kankovsky <kan [AT] dcit.cz> Nick Black <dank [AT] reflexsecurity.com> + Bill Guyton <guyton [AT] bguyton.com> Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to give his permission to use his version of snprintf.c. diff --git a/doc/mergecap.pod b/doc/mergecap.pod index da77ea0fa0..032b78e997 100644 --- a/doc/mergecap.pod +++ b/doc/mergecap.pod @@ -10,7 +10,7 @@ S<[ B<-hva> ]> S<[ B<-s> I<snaplen> ]> S<[ B<-F> I<file format> ]> S<[ B<-T> I<encapsulation type> ]> -S<B<-w> I<outfile>> +S<B<-w> I<outfile>|-> I<infile> I<...> @@ -96,7 +96,7 @@ fddi>' is specified). =item -w -Sets the output filename. +Sets the output filename. If the name is 'B<->', stdout will be used. =item -F @@ -148,3 +148,4 @@ of B<Ethereal> can be found at B<http://www.ethereal.com>. Contributors ------------ + Bill Guyton <guyton[AT]bguyton.com> diff --git a/mergecap.c b/mergecap.c index d5e9534cd5..bc790659b6 100644 --- a/mergecap.c +++ b/mergecap.c @@ -1,6 +1,6 @@ /* Combine two dump files, either by appending or by merging by timestamp * - * $Id: mergecap.c,v 1.18 2004/02/20 20:36:13 gerald Exp $ + * $Id: mergecap.c,v 1.19 2004/03/03 22:14:10 jmayer Exp $ * * Written by Scott Renfro <scott@renfro.org> based on * editcap by Richard Sharpe and Guy Harris @@ -265,6 +265,11 @@ open_outfile(out_file_t *out_file, int snapshot_len) exit(1); } + /* Allow output to stdout by using - */ + if ((strncmp(out_file->filename, "-", 2) == 0) && (strlen(out_file->filename) == 1)) + out_file->filename = ""; + + out_file->pdh = wtap_dump_open(out_file->filename, out_file->file_type, out_file->frame_type, snapshot_len, &err); if (!out_file->pdh) { |