Remove building with NOCRYPTO option
[minix3.git] / external / bsd / nvi / dist / ex / ex_equal.c
blobf18032ef2c1e76f50b4bc202d10e0e834dfe5cdf
1 /* $NetBSD: ex_equal.c,v 1.3 2014/01/26 21:43:45 christos Exp $ */
2 /*-
3 * Copyright (c) 1992, 1993, 1994
4 * The Regents of the University of California. All rights reserved.
5 * Copyright (c) 1992, 1993, 1994, 1995, 1996
6 * Keith Bostic. All rights reserved.
8 * See the LICENSE file for redistribution information.
9 */
11 #include "config.h"
13 #include <sys/cdefs.h>
14 #if 0
15 #ifndef lint
16 static const char sccsid[] = "Id: ex_equal.c,v 10.12 2001/06/25 15:19:15 skimo Exp (Berkeley) Date: 2001/06/25 15:19:15 ";
17 #endif /* not lint */
18 #else
19 __RCSID("$NetBSD: ex_equal.c,v 1.3 2014/01/26 21:43:45 christos Exp $");
20 #endif
22 #include <sys/types.h>
23 #include <sys/queue.h>
25 #include <bitstring.h>
26 #include <limits.h>
27 #include <stdio.h>
29 #include "../common/common.h"
32 * ex_equal -- :address =
34 * PUBLIC: int ex_equal __P((SCR *, EXCMD *));
36 int
37 ex_equal(SCR *sp, EXCMD *cmdp)
39 db_recno_t lno;
41 NEEDFILE(sp, cmdp);
44 * Print out the line number matching the specified address,
45 * or the number of the last line in the file if no address
46 * specified.
48 * !!!
49 * Historically, ":0=" displayed 0, and ":=" or ":1=" in an
50 * empty file displayed 1. Until somebody complains loudly,
51 * we're going to do it right. The tables in excmd.c permit
52 * lno to get away with any address from 0 to the end of the
53 * file, which, in an empty file, is 0.
55 if (F_ISSET(cmdp, E_ADDR_DEF)) {
56 if (db_last(sp, &lno))
57 return (1);
58 } else
59 lno = cmdp->addr1.lno;
61 (void)ex_printf(sp, "%ld\n", (unsigned long)lno);
62 return (0);