- very minor tweak: save 1 byte.
statistics: text data bss dec hex filename 867 0 12 879 36f fold.o.oorig.gcc-3.3 843 0 12 855 357 fold.o.oorig.gcc-3.4 780 0 12 792 318 fold.o.oorig.gcc-4.0 761 0 12 773 305 fold.o.oorig.gcc-4.1-HEAD 761 0 12 773 305 fold.o.oorig.gcc-4.2-HEAD 866 0 12 878 36e fold.o.gcc-3.3 842 0 12 854 356 fold.o.gcc-3.4 779 0 12 791 317 fold.o.gcc-4.0 760 0 12 772 304 fold.o.gcc-4.1-HEAD 760 0 12 772 304 fold.o.gcc-4.2-HEAD
This commit is contained in:
parent
76b24270d4
commit
4bf31272ff
@ -51,7 +51,6 @@ extern int fold_main(int argc, char **argv)
|
||||
int i;
|
||||
int errs = 0;
|
||||
|
||||
|
||||
if(!ENABLE_DEBUG_YANK_SUSv2) {
|
||||
/* Turn any numeric options into -w options. */
|
||||
for (i = 1; i < argc; i++) {
|
||||
@ -78,13 +77,17 @@ extern int fold_main(int argc, char **argv)
|
||||
|
||||
do {
|
||||
FILE *istream = bb_wfopen_input(*argv);
|
||||
if (istream != NULL) {
|
||||
int c;
|
||||
int column = 0; /* Screen column where next char will go. */
|
||||
int offset_out = 0; /* Index in `line_out' for next char. */
|
||||
static char *line_out = NULL;
|
||||
static int allocated_out = 0;
|
||||
|
||||
if (istream == NULL) {
|
||||
errs |= EXIT_FAILURE;
|
||||
continue;
|
||||
}
|
||||
|
||||
while ((c = getc(istream)) != EOF) {
|
||||
if (offset_out + 1 >= allocated_out) {
|
||||
allocated_out += 1024;
|
||||
@ -151,9 +154,6 @@ rescan:
|
||||
bb_perror_msg("%s", *argv); /* Avoid multibyte problems. */
|
||||
errs |= EXIT_FAILURE;
|
||||
}
|
||||
} else {
|
||||
errs |= EXIT_FAILURE;
|
||||
}
|
||||
} while (*++argv);
|
||||
|
||||
bb_fflush_stdout_and_exit(errs);
|
||||
|
Loading…
Reference in New Issue
Block a user