Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/fmt small cleanups from seebs...



details:   https://anonhg.NetBSD.org/src/rev/1a06a2e91e5c
branches:  trunk
changeset: 586373:1a06a2e91e5c
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Dec 15 22:37:37 2005 +0000

description:
small cleanups from seebs...

diffstat:

 usr.bin/fmt/fmt.c |  19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diffs (54 lines):

diff -r 52b8998ba477 -r 1a06a2e91e5c usr.bin/fmt/fmt.c
--- a/usr.bin/fmt/fmt.c Thu Dec 15 22:01:17 2005 +0000
+++ b/usr.bin/fmt/fmt.c Thu Dec 15 22:37:37 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fmt.c,v 1.19 2005/12/15 21:32:00 christos Exp $        */
+/*     $NetBSD: fmt.c,v 1.20 2005/12/15 22:37:37 christos Exp $        */
 
 /*
  * Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)fmt.c      8.1 (Berkeley) 7/20/93";
 #endif
-__RCSID("$NetBSD: fmt.c,v 1.19 2005/12/15 21:32:00 christos Exp $");
+__RCSID("$NetBSD: fmt.c,v 1.20 2005/12/15 22:37:37 christos Exp $");
 #endif /* not lint */
 
 #include <ctype.h>
@@ -347,11 +347,9 @@
 /*
  * Output section.
  * Build up line images from the words passed in.  Prefix
- * each line with correct number of blanks.  The buffer "outbuf"
- * contains the current partial line image, including prefixed blanks.
- * "outp" points to the next available space therein.  When outp is NOSTR,
- * there ain't nothing in there yet.  At the bottom of this whole mess,
- * leading tabs are reinserted.
+ * each line with correct number of blanks.
+ *
+ * At the bottom of this whole mess, leading tabs are reinserted.
  */
 
 /*
@@ -403,8 +401,7 @@
 
 /*
  * If there is anything on the current output line, send it on
- * its way.  Set outp to NOSTR to indicate the absence of the current
- * line prefix.
+ * its way.  Reset outbuf.
  */
 static void
 oflush(void)
@@ -440,8 +437,8 @@
        for (cp = buf->bptr; *cp == ' '; cp++)
                continue;
        b = cp - buf->bptr;
-       t = b >> 3;
-       b &= 07;
+       t = b / 8;
+       b = b % 8;
        if (t > 0)
                do
                        putc('\t', stdout);



Home | Main Index | Thread Index | Old Index