From: Pádraig Brady Date: Sun, 13 Dec 2015 20:16:59 +0000 (+0000) Subject: maint: remove form feed characters from sources X-Git-Tag: v8.25~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f87f1ac1cb2ef44aac4284d8103e7556597a842;p=thirdparty%2Fcoreutils.git maint: remove form feed characters from sources These are no longer useful and can impact viewing patches in some mail programs for example. * src/cksum.c: Remove ^L characters. * src/comm.c: Likewise. * src/kill.c Likewise. * src/ln.c Likewise. * src/nl.c Likewise. * src/pr.c Likewise. * src/ptx.c Likewise. * src/split.c Likewise. * src/tr.c Likewise. * src/tsort.c Likewise. * src/uniq.c Likewise. * src/wc.c Likewise. * cfg.mk (sc_prohibit-form-feed): A new syntax check. --- diff --git a/cfg.mk b/cfg.mk index a2040348cc..70808fd59a 100644 --- a/cfg.mk +++ b/cfg.mk @@ -746,6 +746,12 @@ sc_gitignore_redundant: sort | uniq -d | grep . && { echo '$(ME): Remove above' \ 'entries from .gitignore' >&2; exit 1; } || : +sc_prohibit-form-feed: + @prohibit=$$'\f' \ + in_vc_files='\.[chly]$$' \ + halt='Form Feed (^L) detected' \ + $(_sc_search_regexp) + # Override the default Cc: used in generating an announcement. announcement_Cc_ = $(translation_project_), \ coreutils@gnu.org, coreutils-announce@gnu.org diff --git a/src/cksum.c b/src/cksum.c index ef51010b2d..f0674539bf 100644 --- a/src/cksum.c +++ b/src/cksum.c @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - + /* Written by Q. Frank Xia, qx@math.columbia.edu. Cosmetic changes and reorganization by David MacKenzie, djm@gnu.ai.mit.edu. diff --git a/src/comm.c b/src/comm.c index d4c9f24df8..1ffac4fe33 100644 --- a/src/comm.c +++ b/src/comm.c @@ -15,7 +15,7 @@ along with this program. If not, see . */ /* Written by Richard Stallman and David MacKenzie. */ - + #include #include @@ -91,7 +91,6 @@ static struct option const long_options[] = {NULL, 0, NULL, 0} }; - void usage (int status) diff --git a/src/kill.c b/src/kill.c index 98b270f752..2913d99a61 100644 --- a/src/kill.c +++ b/src/kill.c @@ -32,7 +32,7 @@ #define PROGRAM_NAME "kill" #define AUTHORS proper_name ("Paul Eggert") - + #if ! (HAVE_DECL_STRSIGNAL || defined strsignal) # if ! (HAVE_DECL_SYS_SIGLIST || defined sys_siglist) # if HAVE_DECL__SYS_SIGLIST || defined _sys_siglist @@ -50,7 +50,7 @@ # define strsignal(signum) 0 # endif #endif - + static char const short_options[] = "0::1::2::3::4::5::6::7::8::9::" "A::B::C::D::E::F::G::H::I::J::K::L::M::" @@ -104,7 +104,7 @@ PID is an integer; if negative it identifies a process group.\n\ } exit (status); } - + /* Print a row of 'kill -t' output. NUM_WIDTH is the maximum signal number width, and SIGNUM is the signal number to print. The maximum name width is NAME_WIDTH, and SIGNAME is the name to print. */ @@ -185,7 +185,7 @@ list_signals (bool table, char *const *argv) return status; } - + /* Send signal SIGNUM to all the processes or process groups specified by ARGV. Return a suitable exit status. */ @@ -216,7 +216,7 @@ send_signals (int signum, char *const *argv) return status; } - + int main (int argc, char **argv) { diff --git a/src/ln.c b/src/ln.c index 974a9f0e4c..453167a7dc 100644 --- a/src/ln.c +++ b/src/ln.c @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - + /* Written by Mike Parker and David MacKenzie. */ #include diff --git a/src/nl.c b/src/nl.c index 0430a9b7f1..4f11d0f3b5 100644 --- a/src/nl.c +++ b/src/nl.c @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - + /* Written by Scott Bartram (nancy!scott@uunet.uu.net) Revised by David MacKenzie (djm@gnu.ai.mit.edu) */ diff --git a/src/pr.c b/src/pr.c index a01a0db1c7..c54857bb66 100644 --- a/src/pr.c +++ b/src/pr.c @@ -15,7 +15,7 @@ along with this program. If not, see . */ /* By Pete TerMaat, with considerable refinement by Roland Huebner. */ - + /* Things to watch: Sys V screws up on ... pr -n -3 -s: /usr/dict/words pr -m -o10 -n /usr/dict/words{,,,} @@ -306,7 +306,6 @@ affect -W option.) */ - #include @@ -1171,7 +1170,7 @@ getoptarg (char *arg, char switch_char, char *character, int *number) *number = tmp_long; } } - + /* Set parameters related to formatting. */ static void @@ -1278,7 +1277,7 @@ init_parameters (int number_of_files) free (clump_buff); clump_buff = xmalloc (MAX (8, chars_per_input_tab)); } - + /* Open the necessary files, maintaining a COLUMN structure for each column. @@ -1354,7 +1353,7 @@ init_fps (int number_of_files, char **av) files_ready_to_read = total_files; return true; } - + /* Determine print_func and char_func, the functions used by each column for printing and/or storing. @@ -1441,7 +1440,7 @@ init_funcs (void) p->numbered = numbered_lines && (!parallel_files || i == 1); p->start_position = h; } - + /* Open a file. Return true if successful. With each file p, p->full_page_printed is initialized, @@ -1565,7 +1564,7 @@ reset_status (void) files_ready_to_read = 1; } } - + /* Print a single file, or multiple files in parallel. Set up the list of columns, opening the necessary files. @@ -1600,7 +1599,7 @@ print_files (int number_of_files, char **av) while (print_page ()) ; } - + /* Initialize header information. If DESC is non-negative, it is a file descriptor open to FILENAME for reading. */ @@ -1649,7 +1648,7 @@ init_header (char const *filename, int desc) - mbswidth (date_text, 0) - mbswidth (file_text, 0)); } - + /* Set things up for printing a page Scan through the columns ... @@ -1854,7 +1853,7 @@ print_page (void) return true; /* More pages to go. */ } - + /* Allocate space for storing columns. This is necessary when printing multiple columns from a single file. @@ -2028,7 +2027,7 @@ add_line_number (COLUMN *p) if (truncate_lines && !parallel_files) input_position += number_width; } - + /* Print (or store) padding until the current horizontal position is position. */ @@ -2164,7 +2163,7 @@ skip_read (COLUMN *p, int column_number) if ((!parallel_files || column_number == 1) && !single_ff) ++line_count; } - + /* If we're tabifying output, When print_char encounters white space it keeps track @@ -2710,7 +2709,7 @@ cleanup (void) free (end_vector); free (buff); } - + /* Complain, print a usage message, and die. */ void diff --git a/src/ptx.c b/src/ptx.c index 54d1bc22cc..f21732a1f8 100644 --- a/src/ptx.c +++ b/src/ptx.c @@ -54,7 +54,7 @@ # define MALLOC_FUNC_CHECK 1 # include #endif - + /* Global definitions. */ /* FIXME: There are many unchecked integer overflows in this file, @@ -272,7 +272,7 @@ static BLOCK head; /* head field */ static int head_truncation; /* flag truncation before the head field */ static BLOCK reference; /* reference field for input reference mode */ - + /* Miscellaneous routines. */ /* Diagnose an error in the regular expression matcher. Then exit. */ @@ -524,7 +524,7 @@ swallow_file_in_memory (const char *file_name, BLOCK *block) block->end = block->start + used_length; } - + /* Sort and search routines. */ /*--------------------------------------------------------------------------. @@ -634,7 +634,7 @@ sort_found_occurs (void) qsort (occurs_table[0], number_of_occurs[0], sizeof **occurs_table, compare_occurs); } - + /* Parameter files reading routines. */ /*----------------------------------------------------------------------. @@ -736,7 +736,7 @@ digest_word_file (const char *file_name, WORD_TABLE *table) qsort (table->start, table->length, sizeof table->start[0], compare_words); } - + /* Keyword recognition and selection. */ /*----------------------------------------------------------------------. @@ -1015,7 +1015,7 @@ find_occurs_in_text (size_t file_index) } } } - + /* Formatting and actual output - service routines. */ /*-----------------------------------------. @@ -1189,7 +1189,7 @@ print_field (BLOCK field) putchar (*cursor); } } - + /* Formatting and actual output - planning routines. */ /*--------------------------------------------------------------------. @@ -1552,7 +1552,7 @@ define_all_fields (OCCURS *occurs) SKIP_NON_WHITE (reference.end, right_context_end); } } - + /* Formatting and actual output - control routines. */ /*----------------------------------------------------------------------. @@ -1802,7 +1802,7 @@ generate_all_output (void) occurs_cursor++; } } - + /* Option decoding and main program. */ /*------------------------------------------------------. diff --git a/src/split.c b/src/split.c index 5d6037672a..301f4baa64 100644 --- a/src/split.c +++ b/src/split.c @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - + /* By tege@sics.se, with rms. TODO: diff --git a/src/tr.c b/src/tr.c index a1310a8630..040521058f 100644 --- a/src/tr.c +++ b/src/tr.c @@ -275,7 +275,7 @@ static struct option const long_options[] = {GETOPT_VERSION_OPTION_DECL}, {NULL, 0, NULL, 0} }; - + void usage (int status) { diff --git a/src/tsort.c b/src/tsort.c index 9a84980011..739f68246e 100644 --- a/src/tsort.c +++ b/src/tsort.c @@ -71,7 +71,7 @@ static struct item *loop = NULL; /* The number of strings to sort. */ static size_t n_strings = 0; - + void usage (int status) { diff --git a/src/uniq.c b/src/uniq.c index 79eb40b7f2..4131248ff6 100644 --- a/src/uniq.c +++ b/src/uniq.c @@ -15,7 +15,7 @@ along with this program. If not, see . */ /* Written by Richard M. Stallman and David MacKenzie. */ - + #include #include diff --git a/src/wc.c b/src/wc.c index 33b5ba4dd5..17f7fd4def 100644 --- a/src/wc.c +++ b/src/wc.c @@ -16,7 +16,7 @@ /* Written by Paul Rubin, phr@ocf.berkeley.edu and David MacKenzie, djm@gnu.ai.mit.edu. */ - + #include #include