Mercurial > hg > toybox
changeset 725:e7c14db739c1
Would the compiler like to warn me about declaring two variables with the same name in the same function? No? Carry on then...
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 01 Dec 2012 10:53:03 -0600 |
parents | 9499e4cf830f |
children | 6617899e55f8 |
files | toys/posix/expand.c |
diffstat | 1 files changed, 7 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/toys/posix/expand.c Sat Dec 01 00:42:01 2012 -0600 +++ b/toys/posix/expand.c Sat Dec 01 10:53:03 2012 -0600 @@ -44,30 +44,30 @@ } 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; } } }