=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sendbug/sendbug.c,v retrieving revision 1.59 retrieving revision 1.60 diff -c -r1.59 -r1.60 *** src/usr.bin/sendbug/sendbug.c 2008/12/14 07:46:24 1.59 --- src/usr.bin/sendbug/sendbug.c 2009/01/28 20:43:24 1.60 *************** *** 1,4 **** ! /* $OpenBSD: sendbug.c,v 1.59 2008/12/14 07:46:24 ray Exp $ */ /* * Written by Ray Lai . --- 1,4 ---- ! /* $OpenBSD: sendbug.c,v 1.60 2009/01/28 20:43:24 ray Exp $ */ /* * Written by Ray Lai . *************** *** 39,47 **** --- 39,50 ---- int sendmail(const char *); void template(FILE *); + const char *categories = "system user library documentation kernel " + "alpha amd64 arm hppa i386 m68k m88k mips64 powerpc sh sparc sparc64 vax"; char *version = "4.2"; const char *comment[] = { "", + "", "", "", "" *************** *** 525,531 **** { FILE *fp; size_t len; ! int rval = 0; char *buf; if ((fp = fopen(pathname, "r")) == NULL) { --- 528,534 ---- { FILE *fp; size_t len; ! int category = 0, synopsis = 0; char *buf; if ((fp = fopen(pathname, "r")) == NULL) { *************** *** 533,545 **** return (0); } while ((buf = fgetln(fp, &len))) { ! if (matchline(">Synopsis:", buf, len)) { ! rval = 1; ! break; ! } } fclose(fp); ! return (rval); } void --- 536,548 ---- return (0); } while ((buf = fgetln(fp, &len))) { ! if (matchline(">Category:", buf, len)) ! category = 1; ! else if (matchline(">Synopsis:", buf, len)) ! synopsis = 1; } fclose(fp); ! return (category && synopsis); } void *************** *** 549,554 **** --- 552,562 ---- fprintf(fp, "SENDBUG: Lines starting with `SENDBUG' will" " be removed automatically.\n"); fprintf(fp, "SENDBUG:\n"); + fprintf(fp, "SENDBUG: Choose from the following categories:\n"); + fprintf(fp, "SENDBUG:\n"); + fprintf(fp, "SENDBUG: %s\n", categories); + fprintf(fp, "SENDBUG:\n"); + fprintf(fp, "SENDBUG:\n"); fprintf(fp, "To: %s\n", "gnats@openbsd.org"); fprintf(fp, "Subject: \n"); fprintf(fp, "From: %s\n", pw->pw_name); *************** *** 556,572 **** fprintf(fp, "Reply-To: %s\n", pw->pw_name); fprintf(fp, "\n"); fprintf(fp, ">Synopsis:\t%s\n", comment[0]); fprintf(fp, ">Environment:\n"); fprintf(fp, "\tSystem : %s %s\n", os, rel); fprintf(fp, "\tDetails : %s\n", details); fprintf(fp, "\tArchitecture: %s.%s\n", os, mach); fprintf(fp, "\tMachine : %s\n", mach); fprintf(fp, ">Description:\n"); - fprintf(fp, "\t%s\n", comment[1]); - fprintf(fp, ">How-To-Repeat:\n"); fprintf(fp, "\t%s\n", comment[2]); ! fprintf(fp, ">Fix:\n"); fprintf(fp, "\t%s\n", comment[3]); if (!Dflag) dmesg(fp); --- 564,581 ---- fprintf(fp, "Reply-To: %s\n", pw->pw_name); fprintf(fp, "\n"); fprintf(fp, ">Synopsis:\t%s\n", comment[0]); + fprintf(fp, ">Category:\t%s\n", comment[1]); fprintf(fp, ">Environment:\n"); fprintf(fp, "\tSystem : %s %s\n", os, rel); fprintf(fp, "\tDetails : %s\n", details); fprintf(fp, "\tArchitecture: %s.%s\n", os, mach); fprintf(fp, "\tMachine : %s\n", mach); fprintf(fp, ">Description:\n"); fprintf(fp, "\t%s\n", comment[2]); ! fprintf(fp, ">How-To-Repeat:\n"); fprintf(fp, "\t%s\n", comment[3]); + fprintf(fp, ">Fix:\n"); + fprintf(fp, "\t%s\n", comment[4]); if (!Dflag) dmesg(fp);