*** gnats/ChangeLog Fri Dec 12 21:52:50 1997 --- gnats/ChangeLog Fri Dec 12 21:54:59 1997 *************** *** 1,3 **** --- 1,12 ---- + Fri Dec 5 14:18:16 1997 Karl Fogel + + * file-pr.c (append_report): init `cc' and `subject' to have + newlines, otherwise GNATS sends out mail with misformatted + headers. + (pr_number_from_path): new func. + (append_report): use above new func instead of unreliable + field_value(NUMBER) to determine pr number. + Tue Nov 24 16:00:00 1997 Abe Feldman * file-pr.c: (gnats) If submitter ID is null or default, call *** gnats/file-pr.c Fri Dec 12 21:52:51 1997 --- gnats/file-pr.c Fri Dec 12 21:54:09 1997 *************** *** 814,819 **** --- 814,835 ---- unblock_signals (); } + + /* Get a pr number from its number (just uses basename). + Result is allocated, caller may free. */ + static char * + pr_number_from_path (path) + char *path; + { + char *result; + result = (char *) basename (path); + + if (result != NULL) + return strdup (result); + else + return NULL; + } + /* Append a reply to an existing report. The entire body of the message is appended, while just the To:, From:, Date:, and Subject: lines from the header are included. We used to send notification of the reply *************** *** 833,839 **** Responsible *responsible; Submitter submitter; char *p, *q; ! char *from, *to, *cc = " ", *subject = " ", *date; time_t t; /* Save the values we read while in main(). */ --- 849,856 ---- Responsible *responsible; Submitter submitter; char *p, *q; ! char *number; ! char *from, *to, *cc = " \n", *subject = " \n", *date; time_t t; /* Save the values we read while in main(). */ *************** *** 930,938 **** punt (1, "%s: cannot open mail agent.", program_name); fprintf (msg, "To: %s\n", responsible->alias); if (find_submitter (&submitter, field_value (SUBMITTER)) == -1) punt (0, "%s: PR %s has a Submitter field of `%s', which is invalid.", ! program_name, field_value (NUMBER), field_value (SUBMITTER)); else { char *addr; --- 947,957 ---- punt (1, "%s: cannot open mail agent.", program_name); fprintf (msg, "To: %s\n", responsible->alias); + number = pr_number_from_path (filename); + if (find_submitter (&submitter, field_value (SUBMITTER)) == -1) punt (0, "%s: PR %s has a Submitter field of `%s', which is invalid.", ! program_name, number, field_value (SUBMITTER)); else { char *addr; *************** *** 958,964 **** fprintf (msg, "\n"); fprintf (msg, "The following reply was made to PR %s/%s; it has been noted by GNATS.\n", ! field_value (CATEGORY), field_value (NUMBER)); if (fwrite (buf, sizeof (char), buf_len, msg) != buf_len) { --- 977,983 ---- fprintf (msg, "\n"); fprintf (msg, "The following reply was made to PR %s/%s; it has been noted by GNATS.\n", ! field_value (CATEGORY), number); if (fwrite (buf, sizeof (char), buf_len, msg) != buf_len) {