summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2005-12-10 20:13:54 +0000
committerBernhard Reutner-Fischer2005-12-10 20:13:54 +0000
commitd77b781c1f0f0913b252c8f207f5518e77733dc3 (patch)
tree08eae1b6ca8943a14424799fba78e2508ca5f3cd
parent377bdaff3be5e6598d17b8c32fddad73015f54ab (diff)
downloadbusybox-d77b781c1f0f0913b252c8f207f5518e77733dc3.zip
busybox-d77b781c1f0f0913b252c8f207f5518e77733dc3.tar.gz
- remove unused variable have_read_stdin
- use FLAG_WIDTH
-rw-r--r--coreutils/fold.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/coreutils/fold.c b/coreutils/fold.c
index e45a75b..8f74ed8 100644
--- a/coreutils/fold.c
+++ b/coreutils/fold.c
@@ -48,16 +48,10 @@ static int adjust_column(int column, char c)
extern int fold_main(int argc, char **argv)
{
char *w_opt;
-
- /* If nonzero, at least one of the files we read was standard input. */
- int have_read_stdin = 0;
-
int width = 80;
int i;
int errs = 0;
- have_read_stdin = 0;
-
/* Turn any numeric options into -w options. */
for (i = 1; i < argc; i++) {
char const *a = argv[i];
@@ -77,7 +71,7 @@ extern int fold_main(int argc, char **argv)
}
flags = bb_getopt_ulflags(argc, argv, "bsw:", &w_opt);
- if (flags & 4)
+ if (flags & FLAG_WIDTH)
width = bb_xgetlarg(w_opt, 10, 1, 10000);
argv += optind;
@@ -112,7 +106,7 @@ rescan:
if (column > width) {
/* This character would make the line too long.
- Print the line plus a newline, and make this character
+ Print the line plus a newline, and make this character
start the next line. */
if (flags & FLAG_BREAK_SPACES) {
/* Look for the last blank. */
@@ -167,3 +161,4 @@ rescan:
bb_fflush_stdout_and_exit(errs);
}
+/* vi: set sw=4 ts=4: */