Fix `unexpand -a -t n`, which also did not treat `-t n` like it trunk
authordyoung <dyoung@NetBSD.org>
Fri, 13 Sep 2019 17:26:27 +0000
branchtrunk
changeset 454332 b84f030acc95
parent 454331 661d910e0fd7
child 454333 e68ec3c95752
Fix `unexpand -a -t n`, which also did not treat `-t n` like it established stops n, 2 n, 3 n, ....
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 == ' ') {