Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/unexpand Fix `unexpand -a -t n`, which also did not ...



details:   https://anonhg.NetBSD.org/src/rev/b9bebcee4c79
branches:  trunk
changeset: 1003389:b9bebcee4c79
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Fri Sep 13 17:26:27 2019 +0000

description:
Fix `unexpand -a -t n`, which also did not treat `-t n` like it
established stops n, 2 n, 3 n, ....

diffstat:

 usr.bin/unexpand/unexpand.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r ca0f394f0e95 -r b9bebcee4c79 usr.bin/unexpand/unexpand.c
--- a/usr.bin/unexpand/unexpand.c       Fri Sep 13 16:53:05 2019 +0000
+++ b/usr.bin/unexpand/unexpand.c       Fri Sep 13 17:26:27 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: unexpand.c,v 1.16 2019/09/13 16:53:05 dyoung Exp $     */
+/*     $NetBSD: unexpand.c,v 1.17 2019/09/13 17:26:27 dyoung Exp $     */
 
 /*-
  * Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)unexpand.c 8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: unexpand.c,v 1.16 2019/09/13 16:53:05 dyoung Exp $");
+__RCSID("$NetBSD: unexpand.c,v 1.17 2019/09/13 17:26:27 dyoung Exp $");
 #endif /* not lint */
 
 /*
@@ -136,7 +136,7 @@
        size_t dcol, ocol, limit, n;
 
        dcol = ocol = 0;
-       limit = nstops == 0 ? UINT_MAX : tabstops[nstops - 1] - 1;
+       limit = nstops <= 1 ? UINT_MAX : tabstops[nstops - 1] - 1;
        e = line + len;
        for (p = line; p < e; p++) {
                if (*p == ' ') {



Home | Main Index | Thread Index | Old Index