diff options
| -rwxr-xr-x | color-ls | 15 |
1 files changed, 4 insertions, 11 deletions
@@ -39,8 +39,7 @@ _colorize () { } ncolumns = columns / widest; - i = 1; - while (i <= NR) { + for (i = 1; i <= NR; i++) { # FIXME: this is all jacked up printf("%-*s", widest, all[(row * ncolumns) + (i % ncolumns)]); column += widest; @@ -65,15 +64,13 @@ _colorize () { columns = 80; } - i = 1; - while (i <= NR) { + for (i = 1; i <= NR; i++) { printf("%-*s", widest, all[i]); column += widest; if (column > columns) { printf("\n"); column = 0; } - i++; } if (column != 0) { @@ -82,18 +79,14 @@ _colorize () { } function long_output() { - i = 1; - while (i <= NR) { + for (i = 1; i <= NR; i++) { printf("%s\n", file[i]); - i++; } } function comma_output() { - i = 1; - while (i <= NR) { + for (i = 1; i <= NR; i++) { printf("%s%s", i == 1 ? "" : ", ", $0 ); - i++; } } |
