aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-12-01 10:53:03 -0600
committerRob Landley <rob@landley.net>2012-12-01 10:53:03 -0600
commited7abaf0968a850e262a2ae8f5a8e0b41aaa5879 (patch)
treef71b1ad8c5f5b0033e5ab5a26b97a128e6e5c478
parent6e3876a5a6800e289d34b107bddf71f17c641694 (diff)
downloadtoybox-ed7abaf0968a850e262a2ae8f5a8e0b41aaa5879.tar.gz
Would the compiler like to warn me about declaring two variables with the same name in the same function? No? Carry on then...
-rw-r--r--toys/posix/expand.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/toys/posix/expand.c b/toys/posix/expand.c
index 922f5e67..d1b82a7c 100644
--- a/toys/posix/expand.c
+++ b/toys/posix/expand.c
@@ -44,30 +44,30 @@ static void expand_file(int fd, char *name)
}
if (!len) break;
for (i=0; i<len; i++) {
- int len = 1;
+ int width = 1;
char c = toybuf[i];
if (c != '\t') {
if (EOF == putc(c, stdout)) perror_exit(0);
- if (c == '\b' && x) len = -1;
+ if (c == '\b' && x) width = -1;
if (c == '\n') {
x = stop = 0;
continue;
}
} else {
if (TT.tabcount < 2) {
- len = TT.tabcount ? *TT.tab : 8;
- len -= x%len;
+ width = TT.tabcount ? *TT.tab : 8;
+ width -= x%width;
} else while (stop < TT.tabcount) {
if (TT.tab[stop] > x) {
- len = TT.tab[stop] - x;
+ width = TT.tab[stop] - x;
break;
} else stop++;
}
- xprintf("%*c", len, ' ');
+ xprintf("%*c", width, ' ');
}
- x += len;
+ x += width;
}
}
}