diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2009-06-01 09:07:57 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2009-06-01 09:07:57 +0000 |
commit | c32d9691f9f0565926ad358525a1cd880fcf3967 (patch) | |
tree | e91dbb1fcfe78bb0bdb7a31102390d199842c033 | |
parent | 9471c01d89d6e8355f31af52e502745cab1a6baa (diff) |
Style, inspired by NetBSD.
No binary change.
-rw-r--r-- | games/hack/hack.pager.c | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/games/hack/hack.pager.c b/games/hack/hack.pager.c index ed0b224d32d..507371d2c93 100644 --- a/games/hack/hack.pager.c +++ b/games/hack/hack.pager.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.pager.c,v 1.14 2007/09/14 14:29:20 chl Exp $ */ +/* $OpenBSD: hack.pager.c,v 1.15 2009/06/01 09:07:56 ray Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -62,7 +62,7 @@ */ #ifndef lint -static const char rcsid[] = "$OpenBSD: hack.pager.c,v 1.14 2007/09/14 14:29:20 chl Exp $"; +static const char rcsid[] = "$OpenBSD: hack.pager.c,v 1.15 2009/06/01 09:07:56 ray Exp $"; #endif /* not lint */ /* This file contains the command routine dowhatis() and a pager. */ @@ -89,34 +89,35 @@ dowhatis() char *buf = &bufr[6], *ep, q; extern char readchar(); - if(!(fp = fopen(DATAFILE, "r"))) + if (!(fp = fopen(DATAFILE, "r"))) pline("Cannot open data file!"); else { pline("Specify what? "); q = readchar(); - if(q != '\t') - while(fgets(buf,BUFSZ,fp)) - if(*buf == q) { - ep = strchr(buf, '\n'); - if(ep) *ep = 0; - /* else: bad data file */ - /* Expand tab 'by hand' */ - if(buf[1] == '\t'){ - buf = bufr; - buf[0] = q; - (void) strncpy(buf+1, " ", 7); - } - pline(buf); - if(ep[-1] == ';') { - pline("More info? "); - if(readchar() == 'y') { - page_more(fp,1); /* does fclose() */ + if (q != '\t') + while (fgets(buf,BUFSZ,fp)) + if (*buf == q) { + ep = strchr(buf, '\n'); + if (ep) + *ep = 0; + /* else: bad data file */ + /* Expand tab 'by hand' */ + if (buf[1] == '\t'){ + buf = bufr; + buf[0] = q; + (void) strncpy(buf+1, " ", 7); + } + pline(buf); + if (ep[-1] == ';') { + pline("More info? "); + if (readchar() == 'y') { + page_more(fp,1); /* does fclose() */ + return(0); + } + } + (void) fclose(fp); /* kopper@psuvax1 */ return(0); } - } - (void) fclose(fp); /* kopper@psuvax1 */ - return(0); - } pline("I've never heard of such things."); (void) fclose(fp); } |