summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS1
-rw-r--r--doc/mergecap.pod5
-rw-r--r--mergecap.c7
3 files changed, 10 insertions, 3 deletions
diff --git a/AUTHORS b/AUTHORS
index ee9f400928..48f9803d43 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -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) {