/[gnats]/gnats/gnats/file-pr.c
ViewVC logotype

Diff of /gnats/gnats/file-pr.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.44 by pdm, Sun Dec 23 20:22:20 2001 UTC revision 1.45 by pdm, Sun Feb 10 18:23:42 2002 UTC
# Line 308  createNewPRFile (PR *pr, int flag_autocr Line 308  createNewPRFile (PR *pr, int flag_autocr
308          }          }
309      }      }
310    
311    /* XXX ??? !!! Do we want to do this always, or only if the state is    {
312       empty?  */      /* Ensure the PR has a valid STATE.  We set the default state
313    /* Make sure the PR is in the correct state. */         on any of these cases:
314    set_field (pr,        
315               STATE (database),           1. field_value() returns NULL.
316               fieldDefForIndex(STATE (database))->default_value,          
317               err);           2. if field_value returns the default value.  (field_value in
318                4.0beta1 returns the default, even if it is not really set.)
319    
320             3. if set_field with the existing value fails.  If something
321                used set_field() previously, it was already validated,
322                but we call set_field to validate again to be sure.
323        */
324        char *val = (char *)field_value (pr, STATE (database));
325        char *default_val = fieldDefForIndex (STATE (database))->default_value;
326        
327        if (val != NULL)
328          {
329            val = xstrdup (val);
330          }
331        if (val == NULL
332            || ! strcmp (val, default_val)
333            || ! set_field (pr, STATE (database), val, err))
334          {
335            set_field (pr, STATE (database), default_val, err);
336          }
337        if (val != NULL)
338          {
339            free (val);
340          }
341      }
342    
343    /* Retrieve a unique bug number.  */    /* Retrieve a unique bug number.  */
344    bug_number = getBugNumber (database, err);    bug_number = getBugNumber (database, err);

Legend:
Removed from v.1.44  
changed lines
  Added in v.1.45

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26