projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
a bit more IPv6-ization work
[oweals/busybox.git]
/
coreutils
/
fold.c
diff --git
a/coreutils/fold.c
b/coreutils/fold.c
index 3b5be64fe8b8a673edd96d5864373855aba2e174..fd7298169bf97bd51c000eb01a459164a7bafa44 100644
(file)
--- a/
coreutils/fold.c
+++ b/
coreutils/fold.c
@@
-45,7
+45,7
@@
int fold_main(int argc, char **argv)
int i;
int errs = 0;
int i;
int errs = 0;
- if
(!ENABLE_DEBUG_YANK
_SUSv2) {
+ if
(ENABLE_INCLUDE
_SUSv2) {
/* Turn any numeric options into -w options. */
for (i = 1; i < argc; i++) {
char const *a = argv[i];
/* Turn any numeric options into -w options. */
for (i = 1; i < argc; i++) {
char const *a = argv[i];
@@
-62,7
+62,7
@@
int fold_main(int argc, char **argv)
flags = getopt32(argc, argv, "bsw:", &w_opt);
if (flags & FLAG_WIDTH)
flags = getopt32(argc, argv, "bsw:", &w_opt);
if (flags & FLAG_WIDTH)
- width =
bb_xgetlarg(w_opt, 10
, 1, 10000);
+ width =
xatoul_range(w_opt
, 1, 10000);
argv += optind;
if (!*argv) {
argv += optind;
if (!*argv) {
@@
-70,7
+70,7
@@
int fold_main(int argc, char **argv)
}
do {
}
do {
- FILE *istream =
bb_wfopen_input
(*argv);
+ FILE *istream =
fopen_or_warn_stdin
(*argv);
int c;
int column = 0; /* Screen column where next char will go. */
int offset_out = 0; /* Index in `line_out' for next char. */
int c;
int column = 0; /* Screen column where next char will go. */
int offset_out = 0; /* Index in `line_out' for next char. */
@@
-144,11
+144,11
@@
rescan:
fwrite(line_out, sizeof(char), (size_t) offset_out, stdout);
}
fwrite(line_out, sizeof(char), (size_t) offset_out, stdout);
}
- if (ferror(istream) ||
bb_fclose_non
stdin(istream)) {
+ if (ferror(istream) ||
fclose_if_not_
stdin(istream)) {
bb_perror_msg("%s", *argv); /* Avoid multibyte problems. */
errs |= EXIT_FAILURE;
}
} while (*++argv);
bb_perror_msg("%s", *argv); /* Avoid multibyte problems. */
errs |= EXIT_FAILURE;
}
} while (*++argv);
-
bb_
fflush_stdout_and_exit(errs);
+ fflush_stdout_and_exit(errs);
}
}