]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: remove form feed characters from sources
authorPádraig Brady <P@draigBrady.com>
Sun, 13 Dec 2015 20:16:59 +0000 (20:16 +0000)
committerPádraig Brady <P@draigBrady.com>
Mon, 14 Dec 2015 02:35:10 +0000 (02:35 +0000)
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.

13 files changed:
cfg.mk
src/cksum.c
src/comm.c
src/kill.c
src/ln.c
src/nl.c
src/pr.c
src/ptx.c
src/split.c
src/tr.c
src/tsort.c
src/uniq.c
src/wc.c

diff --git a/cfg.mk b/cfg.mk
index a2040348cce2f9f9ba98cf84bb34b4ec89d02420..70808fd59aa9a1c830b70fd72928ac643db535c2 100644 (file)
--- 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
index ef51010b2d424d95f28d40fd7b656e420bc07529..f0674539bf5bff2e2ea00147793ec7ea0bf21190 100644 (file)
@@ -13,7 +13,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-\f
+
 /* Written by Q. Frank Xia, qx@math.columbia.edu.
    Cosmetic changes and reorganization by David MacKenzie, djm@gnu.ai.mit.edu.
 
index d4c9f24df860145bd76f3a440edbc3350f78e9a3..1ffac4fe33b4c73945d644043c72f86978ebed99 100644 (file)
@@ -15,7 +15,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* Written by Richard Stallman and David MacKenzie. */
-\f
+
 #include <config.h>
 
 #include <getopt.h>
@@ -91,7 +91,6 @@ static struct option const long_options[] =
   {NULL, 0, NULL, 0}
 };
 
-\f
 
 void
 usage (int status)
index 98b270f752ef62bfd7f9427af2898afe5c609b7e..2913d99a61d4da081e1d6b3aa9b1fd6e7d816dcc 100644 (file)
@@ -32,7 +32,7 @@
 #define PROGRAM_NAME "kill"
 
 #define AUTHORS proper_name ("Paul Eggert")
-\f
+
 #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
-\f
+
 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);
 }
-\f
+
 /* 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;
 }
-\f
+
 /* 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;
 }
-\f
+
 int
 main (int argc, char **argv)
 {
index 974a9f0e4c4d6479a88eba7483dbbc26c0d3f52c..453167a7dcc52309f804ce60df18df02faa8565a 100644 (file)
--- 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 <http://www.gnu.org/licenses/>.  */
-\f
+
 /* Written by Mike Parker and David MacKenzie. */
 
 #include <config.h>
index 0430a9b7f147a44e503758460103a8ba90d82aaf..4f11d0f3b5426e393d13834322e2fd2f2d41050f 100644 (file)
--- 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 <http://www.gnu.org/licenses/>.  */
-\f
+
 /* Written by Scott Bartram (nancy!scott@uunet.uu.net)
    Revised by David MacKenzie (djm@gnu.ai.mit.edu) */
 
index a01a0db1c7c7f51523f13030f2925ef2dcbc1da3..c54857bb66c7ab7d6c9cd0cac70b3e0c7fda0bb2 100644 (file)
--- a/src/pr.c
+++ b/src/pr.c
@@ -15,7 +15,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /*  By Pete TerMaat, with considerable refinement by Roland Huebner.  */
-\f
+
 /* Things to watch: Sys V screws up on ...
    pr -n -3 -s: /usr/dict/words
    pr -m -o10 -n /usr/dict/words{,,,}
                 affect -W option.)
 
 */
-\f
 
 #include <config.h>
 
@@ -1171,7 +1170,7 @@ getoptarg (char *arg, char switch_char, char *character, int *number)
       *number = tmp_long;
     }
 }
-\f
+
 /* 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));
 }
-\f
+
 /* 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;
 }
-\f
+
 /* 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;
 }
-\f
+
 /* 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;
     }
 }
-\f
+
 /* 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 ())
     ;
 }
-\f
+
 /* 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));
 }
-\f
+
 /* Set things up for printing a page
 
    Scan through the columns ...
@@ -1854,7 +1853,7 @@ print_page (void)
 
   return true;                 /* More pages to go. */
 }
-\f
+
 /* 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;
 }
-\f
+
 /* 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;
 }
-\f
+
 /* 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);
 }
-\f
+
 /* Complain, print a usage message, and die. */
 
 void
index 54d1bc22cc5b829aa0625f493aa54352c5b6d109..f21732a1f8ac43990c1b8821fc1ad30ac1f9c668 100644 (file)
--- a/src/ptx.c
+++ b/src/ptx.c
@@ -54,7 +54,7 @@
 # define MALLOC_FUNC_CHECK 1
 # include <dmalloc.h>
 #endif
-\f
+
 /* 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 */
-\f
+
 /* 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;
 }
-\f
+
 /* 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);
 }
-\f
+
 /* 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);
 }
-\f
+
 /* Keyword recognition and selection.  */
 
 /*----------------------------------------------------------------------.
@@ -1015,7 +1015,7 @@ find_occurs_in_text (size_t file_index)
         }
     }
 }
-\f
+
 /* Formatting and actual output - service routines.  */
 
 /*-----------------------------------------.
@@ -1189,7 +1189,7 @@ print_field (BLOCK field)
         putchar (*cursor);
     }
 }
-\f
+
 /* Formatting and actual output - planning routines.  */
 
 /*--------------------------------------------------------------------.
@@ -1552,7 +1552,7 @@ define_all_fields (OCCURS *occurs)
       SKIP_NON_WHITE (reference.end, right_context_end);
     }
 }
-\f
+
 /* Formatting and actual output - control routines.  */
 
 /*----------------------------------------------------------------------.
@@ -1802,7 +1802,7 @@ generate_all_output (void)
       occurs_cursor++;
     }
 }
-\f
+
 /* Option decoding and main program.  */
 
 /*------------------------------------------------------.
index 5d6037672a2dd17150f0441a28bb918531249095..301f4baa6411225afeb518c36d7e56781f496776 100644 (file)
@@ -13,7 +13,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-\f
+
 /* By tege@sics.se, with rms.
 
    TODO:
index a1310a8630b562c75563f8be38846f4b7779948b..040521058fc31208c3342f1b7716a5cf2b22c64a 100644 (file)
--- 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}
 };
-\f
+
 void
 usage (int status)
 {
index 9a84980011724d65c525d91c52e387babb709517..739f68246e45ffd90006ed8e1bee0742572349a6 100644 (file)
@@ -71,7 +71,7 @@ static struct item *loop = NULL;
 
 /* The number of strings to sort.  */
 static size_t n_strings = 0;
-\f
+
 void
 usage (int status)
 {
index 79eb40b7f262b24a1dd7091b3f2eb6712ed5cc62..4131248ff613538904399e46d29564842a9e30b1 100644 (file)
@@ -15,7 +15,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* Written by Richard M. Stallman and David MacKenzie. */
-\f
+
 #include <config.h>
 
 #include <getopt.h>
index 33b5ba4dd5b8554ae203ec76d12603f4c43dd242..17f7fd4defab0e283bb45a4200db29c1cebe7e94 100644 (file)
--- 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. */
-\f
+
 #include <config.h>
 
 #include <stdio.h>