]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Don't include "quote.h" when it is not used.
authorJim Meyering <jim@meyering.net>
Fri, 15 Jun 2007 13:44:15 +0000 (15:44 +0200)
committerJim Meyering <jim@meyering.net>
Fri, 15 Jun 2007 13:49:00 +0000 (15:49 +0200)
* src/md5sum.c: Remove unnecessary inclusion of "quote.h".
* src/expr.c: Likewise.
* src/shred.c: Likewise.
* Makefile.maint (sc_prohibit_quote_without_use): New rule.
* src/c99-to-c89.diff: Adjust offsets.

ChangeLog
Makefile.maint
src/c99-to-c89.diff
src/expr.c
src/md5sum.c
src/shred.c

index dc0d24632d915d52bdeb8690c27ecfb7d4352fec..c1cc6aa02ea393518ca14daba3cd40d9454f9d2b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-06-15  Jim Meyering  <jim@meyering.net>
+
+       Don't include "quote.h" when it is not used.
+       * src/md5sum.c: Remove unnecessary inclusion of "quote.h".
+       * src/expr.c: Likewise.
+       * src/shred.c: Likewise.
+       * Makefile.maint (sc_prohibit_quote_without_use): New rule.
+       * src/c99-to-c89.diff: Adjust offsets.
+
 2007-06-14  Paul Eggert  <eggert@cs.ucla.edu>
 
        Clarify what "cat" documentation means by "blank" lines.
index ba5166b3dddfa2acb0305c6c7ed018fd9fda24e5..bb666a4adae10538ec0c8b55270d1505dca5eb9c 100644 (file)
@@ -179,6 +179,18 @@ sc_prohibit_quotearg_without_use:
        else :;                                                         \
        fi
 
+# Don't include quote.h unless you use one of its functions.
+sc_prohibit_quote_without_use:
+       @if $(CVS_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then         \
+         files=$$(grep -l '# *include "quote\.h"'                      \
+                   $$($(CVS_LIST_EXCEPT) | grep '\.c$$')) &&           \
+         grep -LE '\<quote(_n)? \(' $$files                    \
+             | grep . &&                                               \
+           { echo "$(ME): the above files include "quote.h" but don't use it" \
+                 1>&2; exit 1; } || :;                                 \
+       else :;                                                         \
+       fi
+
 sc_obsolete_symbols:
        @grep -nE '\<(HAVE''_FCNTL_H|O''_NDELAY)\>'                     \
             $$($(CVS_LIST_EXCEPT)) &&                                  \
index 4e1aa4aa3fb7284b27d72774f4252a053db63915..e4d2abf72ccd18dbb460db715b04bffa12bab37a 100644 (file)
@@ -106,7 +106,7 @@ retrieving revision 1.130
 diff -u -p -r1.130 shred.c
 --- a/src/shred.c     3 Sep 2006 02:53:16 -0000       1.130
 +++ b/src/shred.c     3 Oct 2006 13:48:24 -0000
-@@ -464,7 +464,7 @@ dopass (int fd, char const *qname, off_t
+@@ -463,7 +463,7 @@ dopass (int fd, char const *qname, off_t
                     out.  Thus, it shouldn't give up on bad blocks.  This
                     code works because lim is always a multiple of
                     SECTOR_SIZE, except at the end.  */
index 57c2591449f0eb70e264cc10773d65f3f86e1a06..47f5832f8eea3adec23524ff63c235a7c52be469 100644 (file)
@@ -1,5 +1,5 @@
 /* expr -- evaluate expressions.
-   Copyright (C) 86, 1991-1997, 1999-2006 Free Software Foundation, Inc.
+   Copyright (C) 86, 1991-1997, 1999-2007 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -37,7 +37,6 @@
 #include "long-options.h"
 #include "error.h"
 #include "inttostr.h"
-#include "quote.h"
 #include "quotearg.h"
 #include "strnumcmp.h"
 #include "xstrtol.h"
index f637bae392bc16586b3e660912dadf8c67cb9ad4..4330e85d14bc398df243458521ff40b7113022ac 100644 (file)
@@ -1,5 +1,5 @@
 /* Compute MD5, SHA1, SHA224, SHA256, SHA384 or SHA512 checksum of files or strings
-   Copyright (C) 1995-2006 Free Software Foundation, Inc.
+   Copyright (C) 1995-2007 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -38,7 +38,6 @@
 #endif
 #include "getline.h"
 #include "error.h"
-#include "quote.h"
 #include "stdio--.h"
 
 /* The official name of this program (e.g., no `g' prefix).  */
index fc6ad67f12f88d0fa01d9668a2c9a47e9871a59e..788f0e70732247941b3934f0289c62714eaafd3e 100644 (file)
@@ -1,6 +1,6 @@
 /* shred.c - overwrite files and devices to make it harder to recover data
 
-   Copyright (C) 1999-2006 Free Software Foundation, Inc.
+   Copyright (C) 1999-2007 Free Software Foundation, Inc.
    Copyright (C) 1997, 1998, 1999 Colin Plumb.
 
    This program is free software; you can redistribute it and/or modify
 #include "human.h"
 #include "inttostr.h"
 #include "quotearg.h"          /* For quotearg_colon */
-#include "quote.h"             /* For quotearg_colon */
 #include "randint.h"
 #include "randread.h"