version 1.11, 2004/06/12 15:04:41 |
version 1.12, 2004/07/22 01:25:25 |
|
|
grep(int f, int n) |
grep(int f, int n) |
{ |
{ |
char command[NFILEN + 20]; |
char command[NFILEN + 20]; |
char prompt[NFILEN]; |
char prompt[NFILEN], *bufp; |
BUFFER *bp; |
BUFFER *bp; |
MGWIN *wp; |
MGWIN *wp; |
|
|
(void)strlcpy(prompt, "grep -n ", sizeof prompt); |
(void)strlcpy(prompt, "grep -n ", sizeof prompt); |
if (eread("Run grep: ", prompt, NFILEN, EFDEF|EFNEW|EFCR) == ABORT) |
if ((bufp = eread("Run grep: ", prompt, NFILEN, EFDEF|EFNEW|EFCR)) |
|
== NULL) |
return ABORT; |
return ABORT; |
|
|
(void)snprintf(command, sizeof command, "%s /dev/null", prompt); |
(void)snprintf(command, sizeof command, "%s /dev/null", bufp); |
|
|
if ((bp = compile_mode("*grep*", command)) == NULL) |
if ((bp = compile_mode("*grep*", command)) == NULL) |
return FALSE; |
return FALSE; |
|
|
compile(int f, int n) |
compile(int f, int n) |
{ |
{ |
char command[NFILEN + 20]; |
char command[NFILEN + 20]; |
char prompt[NFILEN]; |
char prompt[NFILEN], *bufp; |
BUFFER *bp; |
BUFFER *bp; |
MGWIN *wp; |
MGWIN *wp; |
|
|
(void)strlcpy(prompt, compile_last_command, sizeof prompt); |
(void)strlcpy(prompt, compile_last_command, sizeof prompt); |
if (eread("Compile command: ", prompt, NFILEN, EFDEF|EFNEW|EFCR) == ABORT) |
if ((bufp = eread("Compile command: ", prompt, NFILEN, EFDEF|EFNEW|EFCR)) == NULL) |
return ABORT; |
return ABORT; |
(void)strlcpy(compile_last_command, prompt, sizeof compile_last_command); |
(void)strlcpy(compile_last_command, bufp, sizeof compile_last_command); |
|
|
(void)snprintf(command, sizeof command, "%s 2>&1", prompt); |
(void)snprintf(command, sizeof command, "%s 2>&1", bufp); |
|
|
if ((bp = compile_mode("*compile*", command)) == NULL) |
if ((bp = compile_mode("*compile*", command)) == NULL) |
return FALSE; |
return FALSE; |
|
|
gid(int f, int n) |
gid(int f, int n) |
{ |
{ |
char command[NFILEN + 20]; |
char command[NFILEN + 20]; |
char prompt[NFILEN], c; |
char prompt[NFILEN], c, *bufp; |
BUFFER *bp; |
BUFFER *bp; |
MGWIN *wp; |
MGWIN *wp; |
int i, j; |
int i, j; |
|
|
} |
} |
prompt[j] = '\0'; |
prompt[j] = '\0'; |
|
|
if (eread("Run gid (with args): ", prompt, NFILEN, |
if ((bufp = eread("Run gid (with args): ", prompt, NFILEN, |
(j ? EFDEF : 0)|EFNEW|EFCR) == ABORT) |
(j ? EFDEF : 0)|EFNEW|EFCR)) == NULL) |
return ABORT; |
return ABORT; |
(void)snprintf(command, sizeof command, "gid %s", prompt); |
(void)snprintf(command, sizeof command, "gid %s", prompt); |
|
|