renaming the Originator field

Mel Hatzis <[email protected]>
Newsgroups gmane.comp.bug-tracking.gnats.general
Message-ID <[email protected]>
Please review the following patch which fixes a bug associated with
renaming the Originator field:

Index: file-pr.c
===================================================================
RCS file: /cvs/juniper/sw-tools/src/gnats-dbi-4.1/gnats/file-pr.c,v
retrieving revision 1.7
diff -b -u -p -r1.7 file-pr.c
--- file-pr.c   30 Sep 2003 01:35:49 -0000      1.7
+++ file-pr.c   6 Oct 2003 22:43:34 -0000
@@ -126,7 +126,7 @@ createNewPR (PR *pr, ErrorDesc *err)
    /* If originator wasn't set, try to get the value from the From mail
       header.  This is what users usually expect. */
    {
-    FieldIndex idx_origin = find_field_index (database, "Originator");
+    FieldIndex idx_origin = ORIGINATOR (database);
      const char *value_origin = (idx_origin == InvalidFieldIndex
                                 ? NULL
                                 : field_value (pr, idx_origin));


If the Originator field is renamed, an attempt to create a new
PR results in gnatsd executing 'abort' inside set_field.

The fix is to use the "builtin" field name rather than the
field's external name.

--
Mel Hatzis
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.