summaryrefslogtreecommitdiff
path: root/usr.bin/mg/autoexec.c
diff options
context:
space:
mode:
authorDavid Berghoff <db@cvs.openbsd.org>2005-04-03 02:09:29 +0000
committerDavid Berghoff <db@cvs.openbsd.org>2005-04-03 02:09:29 +0000
commitb6dc95251a8aa6c607dcb85f78ca2049dab538f7 (patch)
treeaaa772418d7ccfd0a020a53d1c6d7e85f7f7a47a /usr.bin/mg/autoexec.c
parentbadc0ff2f722af5ded41bf6344b8e76a32e9017d (diff)
This is a no binary change which does:
- spelling, punctuation fixes - variable declaration lineup - use parentheses for return and sizeof - K&R function declarations -> ANSI - other minor code beautification ok henning@
Diffstat (limited to 'usr.bin/mg/autoexec.c')
-rw-r--r--usr.bin/mg/autoexec.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/usr.bin/mg/autoexec.c b/usr.bin/mg/autoexec.c
index 4b9969157f0..591b010f497 100644
--- a/usr.bin/mg/autoexec.c
+++ b/usr.bin/mg/autoexec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoexec.c,v 1.5 2005/03/10 16:58:57 deraadt Exp $ */
+/* $OpenBSD: autoexec.c,v 1.6 2005/04/03 02:09:28 db Exp $ */
/* this file is in the public domain */
/* Author: Vincent Labrecque <vincent@openbsd.org> April 2002 */
@@ -26,8 +26,8 @@ static int ready;
PF *
find_autoexec(const char *fname)
{
- PF *pfl, *npfl;
- int have, used;
+ PF *pfl, *npfl;
+ int have, used;
struct autoexec *ae;
if (!ready)
@@ -58,7 +58,7 @@ find_autoexec(const char *fname)
int
add_autoexec(const char *pattern, const char *func)
{
- PF fp;
+ PF fp;
struct autoexec *ae;
if (!ready) {
@@ -68,7 +68,7 @@ add_autoexec(const char *pattern, const char *func)
fp = name_function(func);
if (fp == NULL)
return (FALSE);
- ae = malloc(sizeof *ae);
+ ae = malloc(sizeof(*ae));
if (ae == NULL)
return (FALSE);
ae->fp = fp;
@@ -85,17 +85,17 @@ add_autoexec(const char *pattern, const char *func)
int
auto_execute(int f, int n)
{
- char patbuf[128], funcbuf[128], *patp, *funcp;
- int s;
+ char patbuf[128], funcbuf[128], *patp, *funcp;
+ int s;
- if ((patp = ereply("Filename pattern: ", patbuf, sizeof patbuf)) == NULL)
- return ABORT;
+ if ((patp = ereply("Filename pattern: ", patbuf, sizeof(patbuf))) == NULL)
+ return (ABORT);
else if (patp[0] == '\0')
- return FALSE;
- if ((funcp = ereply("Execute: ", funcbuf, sizeof funcbuf)) == NULL)
- return ABORT;
+ return (FALSE);
+ if ((funcp = ereply("Execute: ", funcbuf, sizeof(funcbuf))) == NULL)
+ return (ABORT);
else if (funcp[0] == '\0')
- return FALSE;
+ return (FALSE);
if ((s = add_autoexec(patp, funcp)) != TRUE)
return (s);
return (TRUE);