Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/pr PR/41880: Ralph G. Previous fix for PR/5797 broke...



details:   https://anonhg.NetBSD.org/src/rev/cd2eeb286fd2
branches:  trunk
changeset: 778015:cd2eeb286fd2
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Mar 12 18:06:24 2012 +0000

description:
PR/41880: Ralph G. Previous fix for PR/5797 broke since space separator.

diffstat:

 usr.bin/pr/pr.c |  22 ++++------------------
 1 files changed, 4 insertions(+), 18 deletions(-)

diffs (50 lines):

diff -r 8cf9cb8807e7 -r cd2eeb286fd2 usr.bin/pr/pr.c
--- a/usr.bin/pr/pr.c   Mon Mar 12 17:41:59 2012 +0000
+++ b/usr.bin/pr/pr.c   Mon Mar 12 18:06:24 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pr.c,v 1.21 2011/09/06 18:26:06 joerg Exp $    */
+/*     $NetBSD: pr.c,v 1.22 2012/03/12 18:06:24 christos Exp $ */
 
 /*-
  * Copyright (c) 1991 Keith Muller.
@@ -43,7 +43,7 @@
 #if 0
 from: static char sccsid[] = "@(#)pr.c 8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: pr.c,v 1.21 2011/09/06 18:26:06 joerg Exp $");
+__RCSID("$NetBSD: pr.c,v 1.22 2012/03/12 18:06:24 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -1138,14 +1138,7 @@
                        /*
                         * got a non space char; contract out spaces
                         */
-                       while (ops < ips) {
-                               /*
-                                * use one space if necessary
-                                */
-                               if (ips - ops == 1) {
-                                       putchar(' ');
-                                       break;
-                               }
+                       while (ips - ops > 1) {
                                /*
                                 * use as many ochar as will fit
                                 */
@@ -1190,14 +1183,7 @@
                }
 
                if (mor < 0) {
-                       while (ops < ips) {
-                               /*
-                                * use one space if necessary
-                                */
-                               if (ips - ops == 1) {
-                                       putchar(' ');
-                                       break;
-                               }
+                       while (ips - ops > 1) {
                                /*
                                 * use as many ochar as will fit
                                 */



Home | Main Index | Thread Index | Old Index