Source-Changes-HG archive

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

[src/netbsd-1-5]: src/usr.bin/pr Pull up rev 1.8 from trunk:



details:   https://anonhg.NetBSD.org/src/rev/898b4ab4cecc
branches:  netbsd-1-5
changeset: 488489:898b4ab4cecc
user:      simonb <simonb%NetBSD.org@localhost>
date:      Thu Jul 13 03:23:33 2000 +0000

description:
Pull up rev 1.8 from trunk:
 For the -i option, don't convert a single space before a tab stop to a
 tab.  Fixes PR bin/5797 from Todd Vierling.

diffstat:

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

diffs (46 lines):

diff -r 4074f9f4099c -r 898b4ab4cecc usr.bin/pr/pr.c
--- a/usr.bin/pr/pr.c   Thu Jul 13 03:17:59 2000 +0000
+++ b/usr.bin/pr/pr.c   Thu Jul 13 03:23:33 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pr.c,v 1.7 1998/12/19 20:16:50 christos Exp $  */
+/*     $NetBSD: pr.c,v 1.7.10.1 2000/07/13 03:23:33 simonb Exp $       */
 
 /*-
  * Copyright (c) 1991 Keith Muller.
@@ -47,7 +47,7 @@
 #if 0
 from: static char sccsid[] = "@(#)pr.c 8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: pr.c,v 1.7 1998/12/19 20:16:50 christos Exp $");
+__RCSID("$NetBSD: pr.c,v 1.7.10.1 2000/07/13 03:23:33 simonb Exp $");
 #endif
 #endif /* not lint */
 
@@ -1126,6 +1126,13 @@
                         */
                        while (ops < ips) {
                                /*
+                                * use one space if necessary
+                                */
+                               if (ips - ops == 1) {
+                                       putchar(' ');
+                                       break;
+                               }
+                               /*
                                 * use as many ochar as will fit
                                 */
                                if ((tbps = ops + gap - (ops % gap)) > ips)
@@ -1171,6 +1178,13 @@
                if (mor < 0) {
                        while (ops < ips) {
                                /*
+                                * use one space if necessary
+                                */
+                               if (ips - ops == 1) {
+                                       putchar(' ');
+                                       break;
+                               }
+                               /*
                                 * use as many ochar as will fit
                                 */
                                if ((tbps = ops + gap - (ops % gap)) > ips)



Home | Main Index | Thread Index | Old Index