projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
If rcvpack missed file argument, it prints to stdout; Removed unused code.
[mmh]
/
uip
/
rcvpack.c
diff --git
a/uip/rcvpack.c
b/uip/rcvpack.c
index
85de619
..
827373f
100644
(file)
--- a/
uip/rcvpack.c
+++ b/
uip/rcvpack.c
@@
-10,7
+10,6
@@
#include <h/dropsbr.h>
#include <h/rcvmail.h>
#include <h/tws.h>
#include <h/dropsbr.h>
#include <h/rcvmail.h>
#include <h/tws.h>
-#include <h/mts.h>
static struct swit switches[] = {
#define VERSIONSW 0
static struct swit switches[] = {
#define VERSIONSW 0
@@
-36,7
+35,6
@@
main(int argc, char **argv)
/* read user profile/context */
context_read();
/* read user profile/context */
context_read();
- mts_init(invo_name);
arguments = getarguments(invo_name, argc, argv, 1);
argp = arguments;
arguments = getarguments(invo_name, argc, argv, 1);
argp = arguments;
@@
-67,10
+65,14
@@
main(int argc, char **argv)
file = cp;
}
file = cp;
}
- if (!file)
- adios(NULL, "%s [switches] file", invo_name);
-
- rewind(stdin);
+ /* copy stdin to stdout, converting rfc822 message to mbox */
+ if (!file) {
+ if (mbx_copy(fileno(stdout), fileno(stdin)) == NOTOK) {
+ done(RCV_MBX);
+ }
+ done(RCV_MOK);
+ return 1;
+ }
/* open and lock the file */
if ((md = mbx_open(file, getuid(), getgid(), m_gmprot()))
/* open and lock the file */
if ((md = mbx_open(file, getuid(), getgid(), m_gmprot()))
@@
-78,7
+80,7
@@
main(int argc, char **argv)
done(RCV_MBX);
/* append the message */
done(RCV_MBX);
/* append the message */
- if (mbx_copy(file, md, fileno(stdin), 0) == NOTOK) {
+ if (mbx_copy(md, fileno(stdin)) == NOTOK) {
mbx_close(file, md);
done(RCV_MBX);
}
mbx_close(file, md);
done(RCV_MBX);
}