fix ls
This commit is contained in:
parent
0a259a4dce
commit
751421d2e2
|
@ -182,19 +182,18 @@ void col_print(struct d_node **node, size_t files, struct winsize w) {
|
|||
/* Mc print */
|
||||
for (size_t i = 0; i < nrows; i++) {
|
||||
for (size_t j = 0; j < ncols; j++) {
|
||||
if (node[i * ncols + j] == NULL)
|
||||
break;
|
||||
if (i * ncols + j < files) {
|
||||
if (col > 0) {
|
||||
nexttab -= col;
|
||||
for (int k = 0; k < nexttab; k++)
|
||||
putchar(' ');
|
||||
|
||||
if (col > 0) {
|
||||
nexttab -= col;
|
||||
for (int k = 0; k < nexttab; k++)
|
||||
putchar(' ');
|
||||
col += nexttab;
|
||||
}
|
||||
|
||||
col += nexttab;
|
||||
nexttab = col + (int)maxlen;
|
||||
col += print(node[i * ncols + j]);
|
||||
}
|
||||
|
||||
nexttab = col + (int)maxlen;
|
||||
col += print(node[i * ncols + j]);
|
||||
}
|
||||
|
||||
putchar('\n');
|
||||
|
|
Loading…
Reference in New Issue