- /*
- ** If we have given -use flag, or if the
- ** draft is just the same as the components
- ** file, then no need to ask any questions.
- */
- if (use || i)
- goto edit_it;
-
- if (stat(drft, &st) == NOTOK)
- adios(drft, "unable to stat");
- printf("Draft \"%s\" exists (%ld bytes).",
- drft, (long) st.st_size);
- for (i = LISTDSW; i != YESW;) {
- if (!(argp = getans("\nDisposition? ", aqrunl)))
- done(1);
- switch (i = smatch(*argp, aqrunl)) {
- case NOSW:
- done(0);
- case NEWSW:
- use = NOUSE;
- goto try_it_again;
- case YESW:
- break;
- case USELSW:
- use++;
- goto edit_it;
- case LISTDSW:
- showfile(++argp, drft);
- break;
- case REFILSW:
- if (refile(++argp, drft) == 0)
- i = YESW;
- break;
- default:
- advise(NULL, "say what?");
- break;
- }
+ } else {
+ fmtstr = new_fs(form, components);
+ strncpy(drft, m_draft(seq_beyond), sizeof(drft));
+ if ((out = creat(drft, m_gmprot())) == NOTOK) {
+ adios(drft, "unable to create");
+ }
+ if (write(out, fmtstr, strlen(fmtstr)) != strlen(fmtstr)) {
+ adios(drft, "error writing");