summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/mg/buffer.c10
-rw-r--r--usr.bin/mg/cinfo.c4
-rw-r--r--usr.bin/mg/def.h12
-rw-r--r--usr.bin/mg/dired.c62
-rw-r--r--usr.bin/mg/display.c4
-rw-r--r--usr.bin/mg/echo.c7
-rw-r--r--usr.bin/mg/extend.c8
-rw-r--r--usr.bin/mg/file.c4
-rw-r--r--usr.bin/mg/funmap.c8
-rw-r--r--usr.bin/mg/help.c10
-rw-r--r--usr.bin/mg/kbd.c4
-rw-r--r--usr.bin/mg/main.c6
-rw-r--r--usr.bin/mg/modes.c4
-rw-r--r--usr.bin/mg/re_search.c8
-rw-r--r--usr.bin/mg/search.c7
-rw-r--r--usr.bin/mg/tty.c3
-rw-r--r--usr.bin/mg/ttyio.c6
-rw-r--r--usr.bin/mg/window.c4
18 files changed, 90 insertions, 81 deletions
diff --git a/usr.bin/mg/buffer.c b/usr.bin/mg/buffer.c
index b9a7e466b1d..dd8db834f31 100644
--- a/usr.bin/mg/buffer.c
+++ b/usr.bin/mg/buffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: buffer.c,v 1.52 2005/11/18 20:56:52 deraadt Exp $ */
+/* $OpenBSD: buffer.c,v 1.53 2005/12/13 06:01:26 kjell Exp $ */
/* This file is in the public domain. */
@@ -425,18 +425,18 @@ anycb(int f)
{
struct buffer *bp;
int s = FALSE, save = FALSE, ret;
- char prompt[NFILEN + 11];
+ char pbuf[NFILEN + 11];
for (bp = bheadp; bp != NULL; bp = bp->b_bufp) {
if (bp->b_fname != NULL && *(bp->b_fname) != '\0' &&
(bp->b_flag & BFCHG) != 0) {
- ret = snprintf(prompt, sizeof(prompt), "Save file %s",
+ ret = snprintf(pbuf, sizeof(pbuf), "Save file %s",
bp->b_fname);
- if (ret < 0 || ret >= sizeof(prompt)) {
+ if (ret < 0 || ret >= sizeof(pbuf)) {
ewprintf("Error: filename too long!");
return (ABORT);
}
- if ((f == TRUE || (save = eyorn(prompt)) == TRUE) &&
+ if ((f == TRUE || (save = eyorn(pbuf)) == TRUE) &&
buffsave(bp) == TRUE) {
bp->b_flag &= ~BFCHG;
upmodes(bp);
diff --git a/usr.bin/mg/cinfo.c b/usr.bin/mg/cinfo.c
index 26d05bea8ee..0a580445ccd 100644
--- a/usr.bin/mg/cinfo.c
+++ b/usr.bin/mg/cinfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cinfo.c,v 1.14 2005/11/18 20:56:52 deraadt Exp $ */
+/* $OpenBSD: cinfo.c,v 1.15 2005/12/13 06:01:27 kjell Exp $ */
/* This file is in the public domain. */
@@ -92,7 +92,7 @@ const char cinfo[256] = {
* '\0'. Returns NULL on failure.
*/
char *
-keyname(char *cp, size_t len, int k)
+getkeyname(char *cp, size_t len, int k)
{
const char *np;
size_t copied;
diff --git a/usr.bin/mg/def.h b/usr.bin/mg/def.h
index 993eec69a01..f4d7a9b3cc0 100644
--- a/usr.bin/mg/def.h
+++ b/usr.bin/mg/def.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: def.h,v 1.79 2005/12/13 05:23:03 kjell Exp $ */
+/* $OpenBSD: def.h,v 1.80 2005/12/13 06:01:27 kjell Exp $ */
/* This file is in the public domain. */
@@ -310,7 +310,7 @@ int ttputc(int);
void ttflush(void);
int ttgetc(void);
int ttwait(int);
-int typeahead(void);
+int charswaiting(void);
/* dir.c */
void dirinit(void);
@@ -362,7 +362,7 @@ int yank(int, int);
struct mgwin *new_window(struct buffer *);
void free_window(struct mgwin *);
int reposition(int, int);
-int refresh(int, int);
+int redraw(int, int);
int nextwind(int, int);
int prevwind(int, int);
int onlywind(int, int);
@@ -441,7 +441,7 @@ int quit(int, int);
void panic(char *);
/* cinfo.c */
-char *keyname(char *, size_t, int);
+char *getkeyname(char *, size_t, int);
/* basic.c */
int gotobol(int, int);
@@ -482,7 +482,7 @@ int space_to_tabstop(int, int);
int insert(int, int);
int bindtokey(int, int);
int localbind(int, int);
-int define_key(int, int);
+int redefine_key(int, int);
int unbindtokey(int, int);
int localunbind(int, int);
int extend(int, int);
@@ -564,7 +564,7 @@ int blinkparen(int, int);
#ifdef NOTAB
int notabmode(int, int);
#endif /* NOTAB */
-int overwrite(int, int);
+int overwrite_mode(int, int);
int set_default_mode(int,int);
#ifdef REGEX
diff --git a/usr.bin/mg/dired.c b/usr.bin/mg/dired.c
index d2585cb7b19..e9804531982 100644
--- a/usr.bin/mg/dired.c
+++ b/usr.bin/mg/dired.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dired.c,v 1.32 2005/11/20 03:24:17 deraadt Exp $ */
+/* $OpenBSD: dired.c,v 1.33 2005/12/13 06:01:27 kjell Exp $ */
/* This file is in the public domain. */
@@ -175,20 +175,20 @@ dired_init(void)
int
dired(int f, int n)
{
- char dirname[NFILEN], *bufp, *slash;
+ char dname[NFILEN], *bufp, *slash;
struct buffer *bp;
if (curbp->b_fname && curbp->b_fname[0] != '\0') {
- (void)strlcpy(dirname, curbp->b_fname, sizeof(dirname));
- if ((slash = strrchr(dirname, '/')) != NULL) {
+ (void)strlcpy(dname, curbp->b_fname, sizeof(dname));
+ if ((slash = strrchr(dname, '/')) != NULL) {
*(slash + 1) = '\0';
}
} else {
- if (getcwd(dirname, sizeof(dirname)) == NULL)
- dirname[0] = '\0';
+ if (getcwd(dname, sizeof(dname)) == NULL)
+ dname[0] = '\0';
}
- if ((bufp = eread("Dired: ", dirname, NFILEN,
+ if ((bufp = eread("Dired: ", dname, NFILEN,
EFDEF | EFNEW | EFCR)) == NULL)
return (ABORT);
if (bufp[0] == '\0')
@@ -204,21 +204,21 @@ dired(int f, int n)
int
d_otherwindow(int f, int n)
{
- char dirname[NFILEN], *bufp, *slash;
+ char dname[NFILEN], *bufp, *slash;
struct buffer *bp;
struct mgwin *wp;
if (curbp->b_fname && curbp->b_fname[0] != '\0') {
- (void)strlcpy(dirname, curbp->b_fname, sizeof(dirname));
- if ((slash = strrchr(dirname, '/')) != NULL) {
+ (void)strlcpy(dname, curbp->b_fname, sizeof(dname));
+ if ((slash = strrchr(dname, '/')) != NULL) {
*(slash + 1) = '\0';
}
} else {
- if (getcwd(dirname, sizeof(dirname)) == NULL)
- dirname[0] = '\0';
+ if (getcwd(dname, sizeof(dname)) == NULL)
+ dname[0] = '\0';
}
- if ((bufp = eread("Dired other window: ", dirname, NFILEN,
+ if ((bufp = eread("Dired other window: ", dname, NFILEN,
EFDEF | EFNEW | EFCR)) == NULL)
return (ABORT);
else if (bufp[0] == '\0')
@@ -370,7 +370,7 @@ int
d_copy(int f, int n)
{
char frname[NFILEN], toname[NFILEN], *bufp;
- int stat;
+ int ret;
size_t off;
struct buffer *bp;
@@ -388,9 +388,9 @@ d_copy(int f, int n)
return (ABORT);
else if (bufp[0] == '\0')
return (FALSE);
- stat = (copy(frname, toname) >= 0) ? TRUE : FALSE;
- if (stat != TRUE)
- return (stat);
+ ret = (copy(frname, toname) >= 0) ? TRUE : FALSE;
+ if (ret != TRUE)
+ return (ret);
bp = dired_(curbp->b_fname);
return (showbuffer(bp, curwp, WFHARD | WFMODE));
}
@@ -400,7 +400,7 @@ int
d_rename(int f, int n)
{
char frname[NFILEN], toname[NFILEN], *bufp;
- int stat;
+ int ret;
size_t off;
struct buffer *bp;
@@ -418,9 +418,9 @@ d_rename(int f, int n)
return (ABORT);
else if (bufp[0] == '\0')
return (FALSE);
- stat = (rename(frname, toname) >= 0) ? TRUE : FALSE;
- if (stat != TRUE)
- return (stat);
+ ret = (rename(frname, toname) >= 0) ? TRUE : FALSE;
+ if (ret != TRUE)
+ return (ret);
bp = dired_(curbp->b_fname);
return (showbuffer(bp, curwp, WFHARD | WFMODE));
}
@@ -581,34 +581,34 @@ d_makename(struct line *lp, char *fn, int len)
}
/*
- * XXX dirname needs to have enough place to store an additional '/'.
+ * XXX dname needs to have enough place to store an additional '/'.
*/
struct buffer *
-dired_(char *dirname)
+dired_(char *dname)
{
struct buffer *bp;
FILE *dirpipe;
char line[256];
int len, ret;
- if ((dirname = adjustname(dirname)) == NULL) {
+ if ((dname = adjustname(dname)) == NULL) {
ewprintf("Bad directory name");
return (NULL);
}
/* this should not be done, instead adjustname() should get a flag */
- len = strlen(dirname);
- if (dirname[len - 1] != '/') {
- dirname[len++] = '/';
- dirname[len] = '\0';
+ len = strlen(dname);
+ if (dname[len - 1] != '/') {
+ dname[len++] = '/';
+ dname[len] = '\0';
}
- if ((bp = findbuffer(dirname)) == NULL) {
+ if ((bp = findbuffer(dname)) == NULL) {
ewprintf("Could not create buffer");
return (NULL);
}
if (bclear(bp) != TRUE)
return (NULL);
bp->b_flag |= BFREADONLY;
- ret = snprintf(line, sizeof(line), "ls -al %s", dirname);
+ ret = snprintf(line, sizeof(line), "ls -al %s", dname);
if (ret < 0 || ret >= sizeof(line)) {
ewprintf("Path too long");
return (NULL);
@@ -628,7 +628,7 @@ dired_(char *dirname)
return (NULL);
}
bp->b_dotp = lforw(bp->b_linep); /* go to first line */
- (void) strlcpy(bp->b_fname, dirname, sizeof(bp->b_fname));
+ (void) strlcpy(bp->b_fname, dname, sizeof(bp->b_fname));
if ((bp->b_modes[1] = name_mode("dired")) == NULL) {
bp->b_modes[0] = name_mode("fundamental");
ewprintf("Could not find mode dired");
diff --git a/usr.bin/mg/display.c b/usr.bin/mg/display.c
index 49f74a3ead2..80a2b489f9c 100644
--- a/usr.bin/mg/display.c
+++ b/usr.bin/mg/display.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: display.c,v 1.25 2005/12/13 05:40:33 kjell Exp $ */
+/* $OpenBSD: display.c,v 1.26 2005/12/13 06:01:27 kjell Exp $ */
/* This file is in the public domain. */
@@ -371,7 +371,7 @@ update(void)
int currow, curcol;
int offs, size;
- if (typeahead())
+ if (charswaiting())
return;
if (sgarbf) { /* must update everything */
wp = wheadp;
diff --git a/usr.bin/mg/echo.c b/usr.bin/mg/echo.c
index 100eab9034e..f10ae02cebb 100644
--- a/usr.bin/mg/echo.c
+++ b/usr.bin/mg/echo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: echo.c,v 1.41 2005/11/19 20:16:35 kjell Exp $ */
+/* $OpenBSD: echo.c,v 1.42 2005/12/13 06:01:27 kjell Exp $ */
/* This file is in the public domain. */
@@ -461,7 +461,6 @@ veread(const char *fp, char *buf, size_t nbuf, int flag, va_list ap)
ttflush();
}
}
- ret = buf;
done:
if (cwin == TRUE) {
/* blow away cpltion window */
@@ -802,7 +801,7 @@ eformat(const char *fp, va_list ap)
c = *fp++;
switch (c) {
case 'c':
- keyname(kname, sizeof(kname), va_arg(ap, int));
+ getkeyname(kname, sizeof(kname), va_arg(ap, int));
eputs(kname);
break;
@@ -810,7 +809,7 @@ eformat(const char *fp, va_list ap)
for (cp = kname, c = 0; c < key.k_count; c++) {
if (c)
*cp++ = ' ';
- cp = keyname(cp, sizeof(kname) -
+ cp = getkeyname(cp, sizeof(kname) -
(cp - kname) - 1, key.k_chars[c]);
}
eputs(kname);
diff --git a/usr.bin/mg/extend.c b/usr.bin/mg/extend.c
index dacd77eea8d..5f436d04aa9 100644
--- a/usr.bin/mg/extend.c
+++ b/usr.bin/mg/extend.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: extend.c,v 1.41 2005/12/13 05:40:33 kjell Exp $ */
+/* $OpenBSD: extend.c,v 1.42 2005/12/13 06:01:27 kjell Exp $ */
/* This file is in the public domain. */
@@ -360,7 +360,7 @@ dobind(KEYMAP *curmap, const char *p, int unbind)
for (;;) {
ewprintf("%s", bprompt);
pep[-1] = ' ';
- pep = keyname(pep, sizeof(bprompt) -
+ pep = getkeyname(pep, sizeof(bprompt) -
(pep - bprompt), c = getkey(FALSE));
if (doscan(curmap, c, &curmap) != NULL)
break;
@@ -498,7 +498,7 @@ localbind(int f, int n)
*/
/* ARGSUSED */
int
-define_key(int f, int n)
+redefine_key(int f, int n)
{
static char buf[48];
char tmp[32], *bufp;
@@ -747,7 +747,7 @@ excline(char *line)
} else if (fp == localbind || fp == localunbind) {
bind = BINDARG;
curmap = curbp->b_modes[curbp->b_nmodes]->p_map;
- } else if (fp == define_key)
+ } else if (fp == redefine_key)
bind = BINDNEXT;
else
bind = BINDNO;
diff --git a/usr.bin/mg/file.c b/usr.bin/mg/file.c
index d47f28b8a5f..b0bb0324721 100644
--- a/usr.bin/mg/file.c
+++ b/usr.bin/mg/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.47 2005/11/20 04:16:34 kjell Exp $ */
+/* $OpenBSD: file.c,v 1.48 2005/12/13 06:01:27 kjell Exp $ */
/* This file is in the public domain. */
@@ -355,7 +355,7 @@ doneread:
switch (s) {
case FIOSUC:
++nline;
- /* and continue */
+ /* FALLTHRU */
case FIOEOF:
/* the last line of the file */
if ((lp1 = lalloc(nbytes)) == NULL) {
diff --git a/usr.bin/mg/funmap.c b/usr.bin/mg/funmap.c
index d24dcb9b912..8954c4bd29a 100644
--- a/usr.bin/mg/funmap.c
+++ b/usr.bin/mg/funmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: funmap.c,v 1.21 2005/11/20 18:47:11 kjell Exp $ */
+/* $OpenBSD: funmap.c,v 1.22 2005/12/13 06:01:27 kjell Exp $ */
/*
* Copyright (c) 2001 Artur Grabowski <art@openbsd.org>. All rights reserved.
*
@@ -69,7 +69,7 @@ static struct funmap functnames[] = {
{cntmatchlines, "count-matches",},
{cntnonmatchlines, "count-non-matches",},
#endif /* REGEX */
- {define_key, "define-key",},
+ {redefine_key, "define-key",},
{backdel, "delete-backward-char",},
{deblank, "delete-blank-lines",},
{forwdel, "delete-char",},
@@ -146,7 +146,7 @@ static struct funmap functnames[] = {
{notmodified, "not-modified",},
{openline, "open-line",},
{nextwind, "other-window",},
- {overwrite, "overwrite-mode",},
+ {overwrite_mode, "overwrite-mode",},
#ifdef PREFIXREGION
{prefixregion, "prefix-region",},
#endif /* PREFIXREGION */
@@ -166,7 +166,7 @@ static struct funmap functnames[] = {
{re_forwsearch, "re-search-forward",},
#endif /* REGEX */
{reposition, "recenter",},
- {refresh, "redraw-display",},
+ {redraw, "redraw-display",},
{filesave, "save-buffer",},
{quit, "save-buffers-kill-emacs",},
{savebuffers, "save-some-buffers",},
diff --git a/usr.bin/mg/help.c b/usr.bin/mg/help.c
index d84e5045578..05dedd05d3b 100644
--- a/usr.bin/mg/help.c
+++ b/usr.bin/mg/help.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: help.c,v 1.28 2005/12/13 05:40:33 kjell Exp $ */
+/* $OpenBSD: help.c,v 1.29 2005/12/13 06:01:27 kjell Exp $ */
/* This file is in the public domain. */
@@ -48,7 +48,7 @@ desckey(int f, int n)
for (;;) {
ewprintf("%s", dprompt);
pep[-1] = ' ';
- pep = keyname(pep, sizeof(dprompt) - (pep - dprompt),
+ pep = getkeyname(pep, sizeof(dprompt) - (pep - dprompt),
key.k_chars[key.k_count++] = c = getkey(FALSE));
if ((funct = doscan(curmap, c, &curmap)) != NULL)
break;
@@ -140,7 +140,7 @@ showall(struct buffer *bp, KEYMAP *map, char *prefix)
fun = doscan(map, c, &newmap);
if (fun == rescan || fun == selfinsert)
continue;
- keyname(buf, sizeof(buf), c);
+ getkeyname(buf, sizeof(buf), c);
(void)snprintf(key, sizeof(key), "%s%s ", prefix, buf);
if (fun == NULL) {
if (showall(bp, newmap, key) == FALSE)
@@ -220,12 +220,12 @@ findbind(KEYMAP *map, PF fun, char *buf, size_t len)
for (c = 0; c < 256; c++) {
nfun = doscan(map, c, &newmap);
if (nfun == fun) {
- keyname(buf, len, c);
+ getkeyname(buf, len, c);
return (TRUE);
}
if (nfun == NULL) {
if (findbind(newmap, fun, buf2, sizeof(buf2)) == TRUE) {
- keyname(key, sizeof(key), c);
+ getkeyname(key, sizeof(key), c);
(void)snprintf(buf, len, "%s %s", key, buf2);
return (TRUE);
}
diff --git a/usr.bin/mg/kbd.c b/usr.bin/mg/kbd.c
index 5f2b26968cc..79b002747b8 100644
--- a/usr.bin/mg/kbd.c
+++ b/usr.bin/mg/kbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kbd.c,v 1.19 2005/11/19 20:14:38 kjell Exp $ */
+/* $OpenBSD: kbd.c,v 1.20 2005/12/13 06:01:27 kjell Exp $ */
/* This file is in the public domain. */
@@ -109,7 +109,7 @@ getkey(int flag)
}
#ifndef NO_DPROMPT
if (flag && promptp < &prompt[PROMPTL - 5]) {
- promptp = keyname(promptp,
+ promptp = getkeyname(promptp,
sizeof(prompt) - (promptp - prompt) - 1, c);
*promptp++ = '-';
*promptp = '\0';
diff --git a/usr.bin/mg/main.c b/usr.bin/mg/main.c
index 049cbc26881..00325530e2e 100644
--- a/usr.bin/mg/main.c
+++ b/usr.bin/mg/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.47 2005/11/20 18:47:11 kjell Exp $ */
+/* $OpenBSD: main.c,v 1.48 2005/12/13 06:01:27 kjell Exp $ */
/* This file is in the public domain. */
@@ -140,7 +140,7 @@ notnum:
eerase();
#endif /* !NO_DPROMPT */
if (winch_flag) {
- refresh(0, 0);
+ redraw(0, 0);
winch_flag = 0;
}
update();
@@ -152,7 +152,7 @@ notnum:
break;
case ABORT:
ewprintf("Quit");
- /* and fall through */
+ /* FALLTHRU */
case FALSE:
default:
ttbeep();
diff --git a/usr.bin/mg/modes.c b/usr.bin/mg/modes.c
index 0048ab4a646..9b0771ae16d 100644
--- a/usr.bin/mg/modes.c
+++ b/usr.bin/mg/modes.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: modes.c,v 1.14 2005/11/22 04:23:14 kjell Exp $ */
+/* $OpenBSD: modes.c,v 1.15 2005/12/13 06:01:27 kjell Exp $ */
/* This file is in the public domain. */
@@ -98,7 +98,7 @@ notabmode(int f, int n)
#endif /* NOTAB */
int
-overwrite(int f, int n)
+overwrite_mode(int f, int n)
{
if (changemode(f, n, "overwrite") == FALSE)
return (FALSE);
diff --git a/usr.bin/mg/re_search.c b/usr.bin/mg/re_search.c
index ffe546240fe..c1b64af3300 100644
--- a/usr.bin/mg/re_search.c
+++ b/usr.bin/mg/re_search.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: re_search.c,v 1.21 2005/11/18 20:56:53 deraadt Exp $ */
+/* $OpenBSD: re_search.c,v 1.22 2005/12/13 06:01:27 kjell Exp $ */
/* This file is in the public domain. */
@@ -166,6 +166,7 @@ retry:
case CCHR('G'): /* ^G */
(void)ctrlg(FFRAND, 0);
+ goto stopsearch;
case CCHR('['): /* ESC */
case '`':
goto stopsearch;
@@ -446,6 +447,7 @@ re_readpattern(char *prompt)
* Cause case to not matter in searches. This is the default. If called
* with argument cause case to matter.
*/
+/* ARGSUSED*/
int
setcasefold(int f, int n)
{
@@ -468,6 +470,7 @@ setcasefold(int f, int n)
/*
* Delete all lines after dot that contain a string matching regex.
*/
+/* ARGSUSED */
int
delmatchlines(int f, int n)
{
@@ -484,6 +487,7 @@ delmatchlines(int f, int n)
/*
* Delete all lines after dot that don't contain a string matching regex.
*/
+/* ARGSUSED */
int
delnonmatchlines(int f, int n)
{
@@ -543,6 +547,7 @@ killmatches(int cond)
/*
* Count lines matching regex.
*/
+/* ARGSUSED */
int
cntmatchlines(int f, int n)
{
@@ -558,6 +563,7 @@ cntmatchlines(int f, int n)
/*
* Count lines that fail to match regex.
*/
+/* ARGSUSED */
int
cntnonmatchlines(int f, int n)
{
diff --git a/usr.bin/mg/search.c b/usr.bin/mg/search.c
index b59ccd203cc..42da2f5db0d 100644
--- a/usr.bin/mg/search.c
+++ b/usr.bin/mg/search.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: search.c,v 1.26 2005/12/13 05:40:33 kjell Exp $ */
+/* $OpenBSD: search.c,v 1.27 2005/12/13 06:01:27 kjell Exp $ */
/* This file is in the public domain. */
@@ -338,7 +338,8 @@ isearch(int dir)
ewprintf("Mark set");
curwp->w_flag |= WFMOVE;
return (TRUE);
- } /* FALLTHRU */
+ }
+ /* FALLTHRU */
case CCHR('I'):
case CCHR('J'):
addchar:
@@ -419,6 +420,7 @@ is_undo(int *pptr, int *dir)
case SRCH_BEGIN:
case SRCH_NOPR:
*pptr = -1;
+ break;
case SRCH_MARK:
break;
case SRCH_FORW:
@@ -565,6 +567,7 @@ retry:
/* ^G, CR or ESC */
case CCHR('G'):
(void)ctrlg(FFRAND, 0);
+ goto stopsearch;
case CCHR('['):
case CCHR('M'):
goto stopsearch;
diff --git a/usr.bin/mg/tty.c b/usr.bin/mg/tty.c
index 5f5e58a1f4b..55e4323f2fe 100644
--- a/usr.bin/mg/tty.c
+++ b/usr.bin/mg/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.23 2005/11/19 20:16:35 kjell Exp $ */
+/* $OpenBSD: tty.c,v 1.24 2005/12/13 06:01:27 kjell Exp $ */
/* This file is in the public domain. */
@@ -32,6 +32,7 @@
#include <sys/types.h>
#include <sys/time.h>
#include <sys/ioctl.h>
+
#include <term.h>
#include <signal.h>
diff --git a/usr.bin/mg/ttyio.c b/usr.bin/mg/ttyio.c
index 894eef00db7..8828f446746 100644
--- a/usr.bin/mg/ttyio.c
+++ b/usr.bin/mg/ttyio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ttyio.c,v 1.28 2005/06/14 18:14:40 kjell Exp $ */
+/* $OpenBSD: ttyio.c,v 1.29 2005/12/13 06:01:27 kjell Exp $ */
/* This file is in the public domain. */
@@ -167,7 +167,7 @@ ttgetc(void)
ret = read(STDIN_FILENO, &c, 1);
if (ret == -1 && errno == EINTR) {
if (winch_flag) {
- refresh(0, 0);
+ redraw(0, 0);
winch_flag = 0;
}
} else if (ret == 1)
@@ -180,7 +180,7 @@ ttgetc(void)
* Returns TRUE if there are characters waiting to be read.
*/
int
-typeahead(void)
+charswaiting(void)
{
int x;
diff --git a/usr.bin/mg/window.c b/usr.bin/mg/window.c
index bdde3099ee6..f50ffbc975a 100644
--- a/usr.bin/mg/window.c
+++ b/usr.bin/mg/window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window.c,v 1.19 2005/11/18 20:56:53 deraadt Exp $ */
+/* $OpenBSD: window.c,v 1.20 2005/12/13 06:01:27 kjell Exp $ */
/* This file is in the public domain. */
@@ -65,7 +65,7 @@ reposition(int f, int n)
*/
/* ARGSUSED */
int
-refresh(int f, int n)
+redraw(int f, int n)
{
struct mgwin *wp;
int oldnrow, oldncol;