summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/mg/def.h4
-rw-r--r--usr.bin/mg/dired.c6
-rw-r--r--usr.bin/mg/grep.c10
-rw-r--r--usr.bin/mg/help.c14
-rw-r--r--usr.bin/mg/kbd.c10
-rw-r--r--usr.bin/mg/modes.c14
-rw-r--r--usr.bin/mg/undo.c10
7 files changed, 34 insertions, 34 deletions
diff --git a/usr.bin/mg/def.h b/usr.bin/mg/def.h
index f4d7a9b3cc0..04a6bfa9198 100644
--- a/usr.bin/mg/def.h
+++ b/usr.bin/mg/def.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: def.h,v 1.80 2005/12/13 06:01:27 kjell Exp $ */
+/* $OpenBSD: def.h,v 1.81 2005/12/13 07:20:13 kjell Exp $ */
/* This file is in the public domain. */
@@ -585,7 +585,7 @@ int cntnonmatchlines(int, int);
void free_undo_record(struct undo_rec *);
int undo_dump(int, int);
int undo_enable(int);
-int undo_add_boundary(void);
+void undo_add_boundary(void);
int undo_add_insert(struct line *, int, int);
int undo_add_delete(struct line *, int, int);
void undo_no_boundary(int);
diff --git a/usr.bin/mg/dired.c b/usr.bin/mg/dired.c
index e9804531982..f276084229d 100644
--- a/usr.bin/mg/dired.c
+++ b/usr.bin/mg/dired.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dired.c,v 1.33 2005/12/13 06:01:27 kjell Exp $ */
+/* $OpenBSD: dired.c,v 1.34 2005/12/13 07:20:13 kjell Exp $ */
/* This file is in the public domain. */
@@ -35,7 +35,7 @@ static int d_del(int, int);
static int d_rename(int, int);
static int d_shell_command(int, int);
static int d_create_directory(int, int);
-static int d_makename(struct line *, char *, int);
+static int d_makename(struct line *, char *, size_t);
extern struct keymap_s helpmap, cXmap, metamap;
@@ -556,7 +556,7 @@ d_create_directory(int f, int n)
#define NAME_FIELD 8
static int
-d_makename(struct line *lp, char *fn, int len)
+d_makename(struct line *lp, char *fn, size_t len)
{
int i;
char *p, *ep;
diff --git a/usr.bin/mg/grep.c b/usr.bin/mg/grep.c
index 4484c15700a..ffc3cd7382d 100644
--- a/usr.bin/mg/grep.c
+++ b/usr.bin/mg/grep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: grep.c,v 1.25 2005/12/13 02:08:06 kjell Exp $ */
+/* $OpenBSD: grep.c,v 1.26 2005/12/13 07:20:13 kjell Exp $ */
/*
* Copyright (c) 2001 Artur Grabowski <art@openbsd.org>.
* Copyright (c) 2005 Kjell Wooding <kjell@openbsd.org>.
@@ -253,7 +253,7 @@ struct buffer *
compile_mode(const char *name, const char *command, const char *path)
{
struct buffer *bp;
- FILE *pipe;
+ FILE *fpipe;
char *buf;
size_t len;
int ret;
@@ -275,7 +275,7 @@ compile_mode(const char *name, const char *command, const char *path)
ewprintf("Can't change dir to %s", path);
return (NULL);
}
- if ((pipe = popen(command, "r")) == NULL) {
+ if ((fpipe = popen(command, "r")) == NULL) {
ewprintf("Problem opening pipe");
return (NULL);
}
@@ -284,11 +284,11 @@ compile_mode(const char *name, const char *command, const char *path)
* a \n, so we don't need to try to deal with the last line problem
* in fgetln.
*/
- while ((buf = fgetln(pipe, &len)) != NULL) {
+ while ((buf = fgetln(fpipe, &len)) != NULL) {
buf[len - 1] = '\0';
addline(bp, buf);
}
- ret = pclose(pipe);
+ ret = pclose(fpipe);
t = time(NULL);
strftime(timestr, sizeof(timestr), "%a %b %e %T %Y", localtime(&t));
addline(bp, "");
diff --git a/usr.bin/mg/help.c b/usr.bin/mg/help.c
index 05dedd05d3b..54bf7aa5317 100644
--- a/usr.bin/mg/help.c
+++ b/usr.bin/mg/help.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: help.c,v 1.29 2005/12/13 06:01:27 kjell Exp $ */
+/* $OpenBSD: help.c,v 1.30 2005/12/13 07:20:13 kjell Exp $ */
/* This file is in the public domain. */
@@ -128,7 +128,7 @@ static int
showall(struct buffer *bp, KEYMAP *map, char *prefix)
{
KEYMAP *newmap;
- char buf[80], key[16];
+ char buf[80], keybuf[16];
PF fun;
int c;
@@ -141,9 +141,9 @@ showall(struct buffer *bp, KEYMAP *map, char *prefix)
if (fun == rescan || fun == selfinsert)
continue;
getkeyname(buf, sizeof(buf), c);
- (void)snprintf(key, sizeof(key), "%s%s ", prefix, buf);
+ (void)snprintf(keybuf, sizeof(keybuf), "%s%s ", prefix, buf);
if (fun == NULL) {
- if (showall(bp, newmap, key) == FALSE)
+ if (showall(bp, newmap, keybuf) == FALSE)
return (FALSE);
} else {
if (addlinef(bp, "%-16s%s", key,
@@ -213,7 +213,7 @@ findbind(KEYMAP *map, PF fun, char *buf, size_t len)
{
KEYMAP *newmap;
PF nfun;
- char buf2[16], key[16];
+ char buf2[16], keybuf[16];
int c;
/* XXX - 256 ? */
@@ -225,8 +225,8 @@ findbind(KEYMAP *map, PF fun, char *buf, size_t len)
}
if (nfun == NULL) {
if (findbind(newmap, fun, buf2, sizeof(buf2)) == TRUE) {
- getkeyname(key, sizeof(key), c);
- (void)snprintf(buf, len, "%s %s", key, buf2);
+ getkeyname(keybuf, sizeof(keybuf), c);
+ (void)snprintf(buf, len, "%s %s", keybuf, buf2);
return (TRUE);
}
}
diff --git a/usr.bin/mg/kbd.c b/usr.bin/mg/kbd.c
index 79b002747b8..e70e560be36 100644
--- a/usr.bin/mg/kbd.c
+++ b/usr.bin/mg/kbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kbd.c,v 1.20 2005/12/13 06:01:27 kjell Exp $ */
+/* $OpenBSD: kbd.c,v 1.21 2005/12/13 07:20:13 kjell Exp $ */
/* This file is in the public domain. */
@@ -173,12 +173,12 @@ rescan(int f, int n)
KEYMAP *curmap;
int i;
PF fp = NULL;
- int mode = curbp->b_nmodes;
+ int md = curbp->b_nmodes;
for (;;) {
if (ISUPPER(key.k_chars[key.k_count - 1])) {
c = TOLOWER(key.k_chars[key.k_count - 1]);
- curmap = curbp->b_modes[mode]->p_map;
+ curmap = curbp->b_modes[md]->p_map;
for (i = 0; i < key.k_count - 1; i++) {
if ((fp = doscan(curmap, (key.k_chars[i]), &curmap))
!= NULL)
@@ -201,9 +201,9 @@ rescan(int f, int n)
}
}
/* try previous mode */
- if (--mode < 0)
+ if (--md < 0)
return (ABORT);
- curmap = curbp->b_modes[mode]->p_map;
+ curmap = curbp->b_modes[md]->p_map;
for (i = 0; i < key.k_count; i++) {
if ((fp = doscan(curmap, (key.k_chars[i]), &curmap)) != NULL)
break;
diff --git a/usr.bin/mg/modes.c b/usr.bin/mg/modes.c
index 9b0771ae16d..217db94e9c9 100644
--- a/usr.bin/mg/modes.c
+++ b/usr.bin/mg/modes.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: modes.c,v 1.15 2005/12/13 06:01:27 kjell Exp $ */
+/* $OpenBSD: modes.c,v 1.16 2005/12/13 07:20:13 kjell Exp $ */
/* This file is in the public domain. */
@@ -117,15 +117,15 @@ set_default_mode(int f, int n)
{
int i;
struct maps_s *m;
- char mode[32], *bufp;
+ char modebuf[32], *bufp;
- if ((bufp = eread("Set Default Mode: ", mode, sizeof(mode),
+ if ((bufp = eread("Set Default Mode: ", modebuf, sizeof(modebuf),
EFNEW)) == NULL)
return (ABORT);
else if (bufp[0] == '\0')
return (FALSE);
- if ((m = name_mode(mode)) == NULL) {
- ewprintf("can't find mode %s", mode);
+ if ((m = name_mode(modebuf)) == NULL) {
+ ewprintf("can't find mode %s", modebuf);
return (FALSE);
}
if (!(f & FFARG)) {
@@ -156,14 +156,14 @@ set_default_mode(int f, int n)
defb_modes[i] = defb_modes[i + 1];
defb_nmodes--;
}
- if (strcmp(mode, "overwrite") == 0) {
+ if (strcmp(modebuf, "overwrite") == 0) {
if (n <= 0)
defb_flag &= ~BFOVERWRITE;
else
defb_flag |= BFOVERWRITE;
}
#ifdef NOTAB
- if (strcmp(mode, "notab") == 0) {
+ if (strcmp(modebuf, "notab") == 0) {
if (n <= 0)
defb_flag &= ~BFNOTAB;
else
diff --git a/usr.bin/mg/undo.c b/usr.bin/mg/undo.c
index 339beba572f..15ccb15a35b 100644
--- a/usr.bin/mg/undo.c
+++ b/usr.bin/mg/undo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: undo.c,v 1.36 2005/12/13 05:40:33 kjell Exp $ */
+/* $OpenBSD: undo.c,v 1.37 2005/12/13 07:20:13 kjell Exp $ */
/*
* Copyright (c) 2002 Vincent Labrecque <vincent@openbsd.org>
* All rights reserved.
@@ -205,23 +205,23 @@ undo_no_boundary(int flag)
* Record an undo boundary, unless 'nobound' is set via undo_no_boundary.
* Does nothing if previous undo entry is already a boundary.
*/
-int
+void
undo_add_boundary(void)
{
struct undo_rec *rec;
if (nobound)
- return (TRUE);
+ return;
if (lastrectype() == BOUNDARY)
- return (TRUE);
+ return;
rec = new_undo_record();
rec->type = BOUNDARY;
LIST_INSERT_HEAD(&curbp->b_undo, rec, next);
- return (TRUE);
+ return;
}
int