[BACK]Return to sendbug.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / sendbug

Diff for /src/usr.bin/sendbug/sendbug.c between version 1.59 and 1.60

version 1.59, 2008/12/14 07:46:24 version 1.60, 2009/01/28 20:43:24
Line 39 
Line 39 
 int     sendmail(const char *);  int     sendmail(const char *);
 void    template(FILE *);  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";  char *version = "4.2";
 const char *comment[] = {  const char *comment[] = {
         "<synopsis of the problem (one line)>",          "<synopsis of the problem (one line)>",
           "<PR category (one line)>",
         "<precise description of the problem (multiple lines)>",          "<precise description of the problem (multiple lines)>",
         "<code/input/activities to reproduce the problem (multiple lines)>",          "<code/input/activities to reproduce the problem (multiple lines)>",
         "<how to correct or work around the problem, if known (multiple lines)>"          "<how to correct or work around the problem, if known (multiple lines)>"
Line 525 
Line 528 
 {  {
         FILE *fp;          FILE *fp;
         size_t len;          size_t len;
         int rval = 0;          int category = 0, synopsis = 0;
         char *buf;          char *buf;
   
         if ((fp = fopen(pathname, "r")) == NULL) {          if ((fp = fopen(pathname, "r")) == NULL) {
Line 533 
Line 536 
                 return (0);                  return (0);
         }          }
         while ((buf = fgetln(fp, &len))) {          while ((buf = fgetln(fp, &len))) {
                 if (matchline(">Synopsis:", buf, len)) {                  if (matchline(">Category:", buf, len))
                         rval = 1;                          category = 1;
                         break;                  else if (matchline(">Synopsis:", buf, len))
                 }                          synopsis = 1;
         }          }
         fclose(fp);          fclose(fp);
         return (rval);          return (category && synopsis);
 }  }
   
 void  void
Line 549 
Line 552 
         fprintf(fp, "SENDBUG: Lines starting with `SENDBUG' will"          fprintf(fp, "SENDBUG: Lines starting with `SENDBUG' will"
             " be removed automatically.\n");              " be removed automatically.\n");
         fprintf(fp, "SENDBUG:\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, "To: %s\n", "gnats@openbsd.org");
         fprintf(fp, "Subject: \n");          fprintf(fp, "Subject: \n");
         fprintf(fp, "From: %s\n", pw->pw_name);          fprintf(fp, "From: %s\n", pw->pw_name);
Line 556 
Line 564 
         fprintf(fp, "Reply-To: %s\n", pw->pw_name);          fprintf(fp, "Reply-To: %s\n", pw->pw_name);
         fprintf(fp, "\n");          fprintf(fp, "\n");
         fprintf(fp, ">Synopsis:\t%s\n", comment[0]);          fprintf(fp, ">Synopsis:\t%s\n", comment[0]);
           fprintf(fp, ">Category:\t%s\n", comment[1]);
         fprintf(fp, ">Environment:\n");          fprintf(fp, ">Environment:\n");
         fprintf(fp, "\tSystem      : %s %s\n", os, rel);          fprintf(fp, "\tSystem      : %s %s\n", os, rel);
         fprintf(fp, "\tDetails     : %s\n", details);          fprintf(fp, "\tDetails     : %s\n", details);
         fprintf(fp, "\tArchitecture: %s.%s\n", os, mach);          fprintf(fp, "\tArchitecture: %s.%s\n", os, mach);
         fprintf(fp, "\tMachine     : %s\n", mach);          fprintf(fp, "\tMachine     : %s\n", mach);
         fprintf(fp, ">Description:\n");          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, "\t%s\n", comment[2]);
         fprintf(fp, ">Fix:\n");          fprintf(fp, ">How-To-Repeat:\n");
         fprintf(fp, "\t%s\n", comment[3]);          fprintf(fp, "\t%s\n", comment[3]);
           fprintf(fp, ">Fix:\n");
           fprintf(fp, "\t%s\n", comment[4]);
   
         if (!Dflag)          if (!Dflag)
                 dmesg(fp);                  dmesg(fp);

Legend:
Removed from v.1.59  
changed lines
  Added in v.1.60