2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
5 * %sccs.include.redist.c%
9 static char sccsid
[] = "$Id: v_zexit.c,v 8.4 1993/11/26 15:23:09 bostic Exp $ (Berkeley) $Date: 1993/11/26 15:23:09 $";
12 #include <sys/types.h>
22 * Save the file and exit.
25 v_exit(sp
, ep
, vp
, fm
, tm
, rp
)
31 if (F_ISSET(ep
, F_MODIFIED
) &&
32 file_write(sp
, ep
, NULL
, NULL
, NULL
, FS_ALL
))
37 * Historic practice: quit! or two quit's done in succession
38 * (where ZZ counts as a quit) didn't check for other files.
40 * Also check for related screens; if they exist, quit, the
41 * user will get the message on the last screen.
43 if (sp
->ccnt
!= sp
->q_ccnt
+ 1 &&
44 ep
->refcnt
<= 1 && file_next(sp
, 0) != NULL
) {
45 sp
->q_ccnt
= sp
->ccnt
;
47 "More files to edit; use \":n\" to go to the next file");