diff options
author | 2003-04-08 21:19:57 +0000 | |
---|---|---|
committer | 2003-04-08 21:19:57 +0000 | |
commit | 64f834abe04b9158f25cdcced85651d179fbaf8c (patch) | |
tree | c67f274d84fd3c6de5721442ac71535fe1dd07fc | |
parent | missing free(pagname); noticed by vincent (diff) | |
download | wireguard-openbsd-64f834abe04b9158f25cdcced85651d179fbaf8c.tar.xz wireguard-openbsd-64f834abe04b9158f25cdcced85651d179fbaf8c.zip |
remember the last M-x compile command used.
ok art@
-rw-r--r-- | usr.bin/mg/grep.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/mg/grep.c b/usr.bin/mg/grep.c index 37b4bbd5d32..d69799fcfb9 100644 --- a/usr.bin/mg/grep.c +++ b/usr.bin/mg/grep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grep.c,v 1.7 2002/07/25 16:37:54 vincent Exp $ */ +/* $OpenBSD: grep.c,v 1.8 2003/04/08 21:19:57 vincent Exp $ */ /* * Copyright (c) 2001 Artur Grabowski <art@openbsd.org>. All rights reserved. * @@ -37,6 +37,8 @@ static BUFFER *compile_mode(char *name, char *command); void grep_init(void); +static char compile_last_command[NFILEN] = "make "; + /* * Hints for next-error * @@ -100,9 +102,10 @@ compile(int f, int n) BUFFER *bp; MGWIN *wp; - (void)strlcpy(prompt, "make ", sizeof prompt); + (void)strlcpy(prompt, compile_last_command, sizeof prompt); if (eread("Compile command: ", prompt, NFILEN, EFDEF|EFNEW|EFCR) == ABORT) return ABORT; + (void)strlcpy(compile_last_command, prompt, sizeof compile_last_command); (void)snprintf(command, sizeof command, "%s 2>&1", prompt); |