summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJeremie Courreges-Anglas <jca@cvs.openbsd.org>2016-05-18 19:10:27 +0000
committerJeremie Courreges-Anglas <jca@cvs.openbsd.org>2016-05-18 19:10:27 +0000
commit49915650b5f46a562ed8f9e00b4e1927a89bc5c3 (patch)
treeefe857c149d973fddc333cffa03af35dd24e2731 /usr.bin
parent7236eec3d86f1262e99ca88846fe1b5a060fb765 (diff)
Also print a warning if the user doesn't fill the mail Subject
Alternative diff by Tim (trondd ! kagu-tsuchi . com), ok tedu@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/sendbug/sendbug.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/sendbug/sendbug.c b/usr.bin/sendbug/sendbug.c
index 0675605931a..6ac97306d32 100644
--- a/usr.bin/sendbug/sendbug.c
+++ b/usr.bin/sendbug/sendbug.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sendbug.c,v 1.75 2016/05/18 19:06:25 jca Exp $ */
+/* $OpenBSD: sendbug.c,v 1.76 2016/05/18 19:10:26 jca Exp $ */
/*
* Written by Ray Lai <ray@cyth.net>.
@@ -512,7 +512,7 @@ checkfile(const char *pathname)
{
FILE *fp;
size_t len;
- int category = 0, synopsis = 0;
+ int category = 0, synopsis = 0, subject = 0;
char *buf;
if ((fp = fopen(pathname, "r")) == NULL) {
@@ -524,10 +524,14 @@ checkfile(const char *pathname)
category = 1;
else if (matchline(">Synopsis:", buf, len))
synopsis = 1;
+ else if (matchline("Subject:", buf, len))
+ subject = 1;
}
fclose(fp);
- if (!category || !synopsis) {
+ if (!category || !synopsis || !subject) {
fprintf(stderr, "Some fields are blank, please fill them in: ");
+ if (!subject)
+ fprintf(stderr, "Subject ");
if (!synopsis)
fprintf(stderr, "Synopsis ");
if (!category)