projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
replace obsolete autoconf macros
[mmh]
/
uip
/
send.c
diff --git
a/uip/send.c
b/uip/send.c
index
ec81aaa
..
514f073
100644
(file)
--- a/
uip/send.c
+++ b/
uip/send.c
@@
-102,6
+102,8
@@
static struct swit switches[] = {
{ "saslmech", SASLminc(-5) },
#define USERSW 39
{ "user", SASLminc(-4) },
{ "saslmech", SASLminc(-5) },
#define USERSW 39
{ "user", SASLminc(-4) },
+#define ATTACHSW 40
+ { "attach", 6 },
{ NULL, 0 }
};
{ NULL, 0 }
};
@@
-127,7
+129,6
@@
extern char *altmsg; /* .. */
extern char *annotext;
extern char *distfile;
extern char *annotext;
extern char *distfile;
-extern int errno;
int
main (int argc, char **argv)
int
main (int argc, char **argv)
@@
-140,6
+141,7
@@
main (int argc, char **argv)
char *msgs[MAXARGS], *vec[MAXARGS];
struct msgs *mp;
struct stat st;
char *msgs[MAXARGS], *vec[MAXARGS];
struct msgs *mp;
struct stat st;
+ char *attach = (char *)0; /* header field name for attachments */
#ifdef UCI
FILE *fp;
#endif /* UCI */
#ifdef UCI
FILE *fp;
#endif /* UCI */
@@
-273,6
+275,11
@@
main (int argc, char **argv)
adios (NULL, "missing argument to %s", argp[-2]);
vec[vecp++] = cp;
continue;
adios (NULL, "missing argument to %s", argp[-2]);
vec[vecp++] = cp;
continue;
+
+ case ATTACHSW:
+ if (!(attach = *argp++) || *attach == '-')
+ adios (NULL, "missing argument to %s", argp[-2]);
+ continue;
}
} else {
msgs[msgp++] = cp;
}
} else {
msgs[msgp++] = cp;
@@
-436,7
+443,7
@@
go_to_it:
closefds (3);
for (msgnum = 0; msgnum < msgp; msgnum++) {
closefds (3);
for (msgnum = 0; msgnum < msgp; msgnum++) {
- switch (sendsbr (vec, vecp, msgs[msgnum], &st, 1)) {
+ switch (sendsbr (vec, vecp, msgs[msgnum], &st, 1, attach)) {
case DONE:
done (++status);
case NOTOK:
case DONE:
done (++status);
case NOTOK: