diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2000-01-05 16:00:20 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2000-01-05 16:00:20 +0000 |
commit | c23ce26c3e78a597819d65f52f79d478246bcd05 (patch) | |
tree | a5471286a32d83525e449625ceb89ce0aae1073a | |
parent | 6dec872b94e70582dbf55af738232c1e3e67ad11 (diff) |
Perform colwidth computation sooner, as there's no need for random
access if we end up doing one column output.
-rw-r--r-- | bin/ls/print.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/ls/print.c b/bin/ls/print.c index 37596ae48cc..ad9472eb8f6 100644 --- a/bin/ls/print.c +++ b/bin/ls/print.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print.c,v 1.12 2000/01/05 15:58:27 espie Exp $ */ +/* $OpenBSD: print.c,v 1.13 2000/01/05 16:00:19 espie Exp $ */ /* $NetBSD: print.c,v 1.15 1996/12/11 03:25:39 thorpej Exp $ */ /* @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)print.c 8.5 (Berkeley) 7/28/94"; #else -static char rcsid[] = "$OpenBSD: print.c,v 1.12 2000/01/05 15:58:27 espie Exp $"; +static char rcsid[] = "$OpenBSD: print.c,v 1.13 2000/01/05 16:00:19 espie Exp $"; #endif #endif /* not lint */ @@ -174,6 +174,9 @@ printcol(dp) int base, chcnt, col, colwidth, num; int numcols, numrows, row; + if ( (colwidth = compute_columns(dp, &numcols)) == 0) + return; + /* * Have to do random access in the linked list -- build a table * of pointers. @@ -194,9 +197,6 @@ printcol(dp) if (p->fts_number != NO_PRINT) array[num++] = p; - if ( (colwidth = compute_columns(dp, &numcols)) == 0) - return; - numrows = num / numcols; if (num % numcols) ++numrows; |