summaryrefslogtreecommitdiffstats
path: root/usr.bin/sendbug/sendbug.c
diff options
context:
space:
mode:
authorjca <jca@openbsd.org>2016-05-18 19:10:26 +0000
committerjca <jca@openbsd.org>2016-05-18 19:10:26 +0000
commit2dbd25f1db3bdac1113c97bb958ec6ba727bfba0 (patch)
tree6ccd5e1ef7d347b06e8408fe917002efeb357292 /usr.bin/sendbug/sendbug.c
parentPrint a user-friendly message if some fields are missing; ok tedu@ (diff)
downloadwireguard-openbsd-2dbd25f1db3bdac1113c97bb958ec6ba727bfba0.tar.xz
wireguard-openbsd-2dbd25f1db3bdac1113c97bb958ec6ba727bfba0.zip
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/sendbug/sendbug.c')
-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)