summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcolor-ls15
1 files changed, 4 insertions, 11 deletions
diff --git a/color-ls b/color-ls
index 5b0930f..16ba632 100755
--- a/color-ls
+++ b/color-ls
@@ -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++;
}
}