summaryrefslogtreecommitdiff
path: root/usr.bin/mg/grep.c
diff options
context:
space:
mode:
authorMark Lumsden <lum@cvs.openbsd.org>2019-07-11 18:20:19 +0000
committerMark Lumsden <lum@cvs.openbsd.org>2019-07-11 18:20:19 +0000
commit68d5d4acf1ba64582d9f55ae219a12145f552f74 (patch)
treebea90fae58f6492677459e2d163470d1caa7e3cb /usr.bin/mg/grep.c
parentd9873d02f5ac253f95bc31c8e11057525e35f834 (diff)
Allow functions that have 1 or more parameters receive and process
multiple arguments when evaluated in a startup file or via one of the 'eval' commands. This diff does treat the '(' and ')' chars differently during evaluation than previously, in-so-far as they are not ignored if they are at the end or start of a line now. However, even though these characters are not ignored, this diff should not change the behaviour of an extant .mg file, with '(' and ')' chars at the end and start of a line. This situation is accomodated for in this diff (with limited testing though).
Diffstat (limited to 'usr.bin/mg/grep.c')
-rw-r--r--usr.bin/mg/grep.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/mg/grep.c b/usr.bin/mg/grep.c
index c3e874a6bcb..97d22c68a81 100644
--- a/usr.bin/mg/grep.c
+++ b/usr.bin/mg/grep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: grep.c,v 1.47 2018/12/30 23:09:58 guenther Exp $ */
+/* $OpenBSD: grep.c,v 1.48 2019/07/11 18:20:18 lum Exp $ */
/* This file is in the public domain */
@@ -53,11 +53,11 @@ static struct KEYMAPE (1) compilemap = {
void
grep_init(void)
{
- funmap_add(compile_goto_error, "compile-goto-error");
- funmap_add(next_error, "next-error");
- funmap_add(grep, "grep");
- funmap_add(compile, "compile");
- funmap_add(gid, "gid");
+ funmap_add(compile_goto_error, "compile-goto-error", 0);
+ funmap_add(next_error, "next-error", 0);
+ funmap_add(grep, "grep", 1);
+ funmap_add(compile, "compile", 0);
+ funmap_add(gid, "gid", 1);
maps_add((KEYMAP *)&compilemap, "compile");
}