From da7a704cd36e1d2015d14247e5139fb1999b2211 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 1 May 2010 14:24:35 +0200 Subject: maint: replace each "for (;;)" with "while (true)" Run this command: git ls-files | grep '\.[ch]$' \ | xargs perl -pi -e 's/for \(;;\)/while (true)/g' ...except for randint.c, which does not include stdbool.h. In that case, use "while (1)". * gl/lib/randint.c (randint_genmax): Use "while (1)" for infloops. * src/cat.c (simple_cat, cat): Use "while (true)" for infloops. * gl/lib/randread.c (readsource, readisaac): Likewise. * src/copy.c (copy_reg): Likewise. * src/csplit.c (record_line_starts, process_regexp): Likewise. * src/cut.c (set_fields): Likewise. * src/dd.c (iread, parse_symbols): Likewise. * src/df.c (find_mount_point, main): Likewise. * src/du.c (main): Likewise. * src/expand.c (expand): Likewise. * src/factor.c (factor_using_division, do_stdin): Likewise. * src/fmt.c (get_space): Likewise. * src/ls.c (decode_switches): Likewise. * src/od.c (main): Likewise. * src/pr.c (main, read_line): Likewise. * src/shred.c (dopass, genpattern): Likewise. * src/sort.c (initbuf, fillbuf, getmonth, keycompare): Likewise. * src/split.c (bytes_split, lines_split): Likewise. * src/tac.c (tac_seekable): Likewise. * src/test.c (and, or): Likewise. * src/tr.c (squeeze_filter, main): Likewise. * src/tsort.c (search_item): Likewise. * src/unexpand.c (unexpand): Likewise. * src/uniq.c (main): Likewise. * src/yes.c (main): Likewise. --- src/unexpand.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/unexpand.c') diff --git a/src/unexpand.c b/src/unexpand.c index dfe93053f..a3bb4a88e 100644 --- a/src/unexpand.c +++ b/src/unexpand.c @@ -299,7 +299,7 @@ unexpand (void) allocate MAX_COLUMN_WIDTH bytes to store the blanks. */ pending_blank = xmalloc (max_column_width); - for (;;) + while (true) { /* Input character, or EOF. */ int c; @@ -351,7 +351,7 @@ unexpand (void) next_tab_column = column + (tab_size - column % tab_size); else - for (;;) + while (true) if (tab_index == first_free_tab) { convert = false; -- cgit v1.2.3-54-g00ecf