rework initial error handling -- since we check for any screens on
[nvi.git] / ex / ex_equal.c
blob5b96668f004b35d26305763eee7afa24156ebbfd
1 /*-
2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
5 * %sccs.include.redist.c%
6 */
8 #ifndef lint
9 static char sccsid[] = "$Id: ex_equal.c,v 8.4 1993/11/02 18:46:48 bostic Exp $ (Berkeley) $Date: 1993/11/02 18:46:48 $";
10 #endif /* not lint */
12 #include <sys/types.h>
14 #include "vi.h"
15 #include "excmd.h"
18 * ex_equal -- :address =
19 * Print out the line number matching the specified address, or the
20 * last line number in the file if no address specified.
22 int
23 ex_equal(sp, ep, cmdp)
24 SCR *sp;
25 EXF *ep;
26 EXCMDARG *cmdp;
28 recno_t lno;
30 if (F_ISSET(cmdp, E_ADDRDEF)) {
31 if (file_lline(sp, ep, &lno))
32 return (1);
33 (void)ex_printf(EXCOOKIE, "%ld\n", lno);
34 } else
35 (void)ex_printf(EXCOOKIE, "%ld\n", cmdp->addr1.lno);
36 return (0);