summaryrefslogtreecommitdiff
path: root/usr.bin/mg/grep.c
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2005-05-25 20:15:19 +0000
committerJason Wright <jason@cvs.openbsd.org>2005-05-25 20:15:19 +0000
commitdcead8eae5fdd83039dc65adef084e38468592fb (patch)
treed228497dcf37a70a7e290c681fef3b414265b334 /usr.bin/mg/grep.c
parent702694f6bb39cca0db1f44bd206ffe77713d8fe2 (diff)
in M-x compile, after prompting for command, check buffers and optionally
save them. ok cloder@
Diffstat (limited to 'usr.bin/mg/grep.c')
-rw-r--r--usr.bin/mg/grep.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/mg/grep.c b/usr.bin/mg/grep.c
index 1ca10e0c51e..44fc2a4d937 100644
--- a/usr.bin/mg/grep.c
+++ b/usr.bin/mg/grep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: grep.c,v 1.13 2005/04/03 02:09:28 db Exp $ */
+/* $OpenBSD: grep.c,v 1.14 2005/05/25 20:15:18 jason Exp $ */
/*
* Copyright (c) 2001 Artur Grabowski <art@openbsd.org>. All rights reserved.
*
@@ -108,6 +108,8 @@ compile(int f, int n)
(void)strlcpy(prompt, compile_last_command, sizeof(prompt));
if ((bufp = eread("Compile command: ", prompt, NFILEN, EFDEF|EFNEW|EFCR)) == NULL)
return (ABORT);
+ if (savebuffers(f, n) == ABORT)
+ return (ABORT);
(void)strlcpy(compile_last_command, bufp, sizeof(compile_last_command));
(void)snprintf(command, sizeof(command), "%s 2>&1", bufp);