Ticket #45258: patch-config.h.diff

File patch-config.h.diff, 16.8 KB (added by ryandesign (Ryan Carsten Schmidt), 10 years ago)
  • auxfiles/Makefile.am

    http://lists.gnu.org/archive/html/bug-cssc/2014-09/msg00003.html
    http://git.savannah.gnu.org/cgit/cssc.git/commit/?id=9737f41b5d2a49e61061e9f896b5a9ae19e3a3ac
    diff --git a/auxfiles/Makefile.am b/auxfiles/Makefile.am
    index b08555d..51751a6 100644
    a b  
    1 EXTRA_DIST = check-testfiles.sh
     1EXTRA_DIST = check-testfiles.sh firstinclude.sed
    22
    33dist-hook: CSSC.spec
    44        cp CSSC.spec $(distdir)/CSSC.spec
  • (a) a/dev/null vs. (b) b/auxfiles/firstinclude.sed

    diff --git a/auxfiles/firstinclude.sed b/auxfiles/firstinclude.sed
    new file mode 100644
    index 0000000..df1714a
    a b  
     1/^ *# *include ["<].*[">]/ {
     2s/^ *# *include ["<]\(.*\)[">]/\1/
     3t YESREALLY
     4i\
     5Internal error - regexes are inconsistent
     6q
     7: YESREALLY
     8#s/^\(config\|cssc\).h$//
     9s/^config\.h$//
     10t OK
     11=
     12i\
     13config.h should be #included first
     14: OK
     15# q with an exit code is a GNU extension, don't use it.
     16q
     17}
     18
     19   
     20 No newline at end of file
  • src/Makefile.am

    diff --git a/src/Makefile.am b/src/Makefile.am
    index 7a9bd3a..7eb9de3 100644
    a b sccs_LDADD = libcssc.a $(LIBOBJS) -lgnulib 
    112112sccsdiff: sccsdiff.sh
    113113        sed -e 's:__csscutildir__:$(csscutildir):g' < sccsdiff.sh > $@ && chmod a+x $@ || { rm -f $@; false; }
    114114
     115check-include-order:
     116        rv=0; \
     117        for f in $(srcdir)/*.cc; \
     118        do \
     119                msg="`sed -n -f $(top_srcdir)/auxfiles/firstinclude.sed < $$f`"; \
     120                if test -n "$${msg}"; \
     121                then \
     122                        set -- $${msg} ; line=$${1} ; shift; errmsg="$${*}"; \
     123                        echo "$${f}:$${line}:$${errmsg}" >&2; \
     124                        rv=1; \
     125                fi \
     126        done; \
     127        exit $${rv}
     128
    115129testsplit$(EXEEXT): fnsplit.cc mystring.$(OBJEXT) quit.$(OBJEXT)
    116130        $(CXXCOMPILE) -DTEST_FNSPLIT -o testsplit$(EXEEXT) \
    117131                $(srcdir)/fnsplit.cc mystring.$(OBJEXT) quit.$(OBJEXT)
  • src/admin.cc

    diff --git a/src/admin.cc b/src/admin.cc
    index 88e527e..e46ec1c 100644
    a b  
    2323 * Administer and create SCCS files.
    2424 *
    2525 */
     26#include <config.h>
     27
    2628#include <errno.h>
    2729
    2830#include "cssc.h"
  • src/bodyio.cc

    diff --git a/src/bodyio.cc b/src/bodyio.cc
    index 3d3794d..05a98f6 100644
    a b  
    2323 *
    2424 */
    2525
     26#include <config.h>
     27
     28#include <cstdio>
     29#include <cstring>
     30
     31#include "cssc.h"
    2632#include "bodyio.h"
    2733#include "quit.h"
    2834#include "cssc-assert.h"
     
    3238#include "ioerr.h"
    3339#include "file.h"
    3440
    35 #include <cstdio>
    36 #include <cstring>
    37 
    3841/* Check if we have exceeded the maximum line length.
    3942 */
    4043static bool check_line_len(const char *iname,
  • src/cap.cc

    diff --git a/src/cap.cc b/src/cap.cc
    index 226c463..d6d0810 100644
    a b  
    2323 * Utilities for limiting output to the constraints of the file format.
    2424 */
    2525
     26#include <config.h>
     27
    2628#include "cssc.h"
    2729
    2830
  • src/cdc.cc

    diff --git a/src/cdc.cc b/src/cdc.cc
    index c258f8c..df8f9c4 100644
    a b  
    2323 *
    2424 */
    2525
     26#include <config.h>
     27
    2628#include "cssc.h"
    2729#include "my-getopt.h"
    2830#include "fileiter.h"
  • src/delta-iterator.cc

    diff --git a/src/delta-iterator.cc b/src/delta-iterator.cc
    index c6daf0b..808864c 100644
    a b  
    2525 *
    2626 */
    2727
     28#include <config.h>
     29
     30#include "cssc.h"
    2831#include "delta-iterator.h"
    2932#include "delta-table.h"
    3033#include "cssc-assert.h"
  • src/delta-table.cc

    diff --git a/src/delta-table.cc b/src/delta-table.cc
    index 196f7fd..b7c758a 100644
    a b  
    2222 *
    2323 */
    2424
     25#include <config.h>
     26
     27#include "cssc.h"
    2528#include "delta-table.h"
    2629#include "delta-iterator.h"
    2730
  • src/delta.cc

    diff --git a/src/delta.cc b/src/delta.cc
    index 48eb367..8dfe3bd 100644
    a b  
    2424 *
    2525 */
    2626
     27
     28#include <config.h>
     29
     30#include "cssc.h"
    2731#include "delta.h"
    2832#include "cleanup.h"
    2933#include "my-getopt.h"
  • src/dtbl-prepend.cc

    diff --git a/src/dtbl-prepend.cc b/src/dtbl-prepend.cc
    index c85e6be..f6ecfc7 100644
    a b  
    2424 *
    2525 */
    2626
     27#include <config.h>
     28
     29#include "cssc.h"
    2730#include "delta-table.h"
    2831
    2932
  • src/encoding.cc

    diff --git a/src/encoding.cc b/src/encoding.cc
    index f62782c..b37724e 100644
    a b  
    2525 * Compile on its own, defining TEST_CODE, to compile a test program.
    2626 */
    2727
     28#include <config.h>
     29
     30#include "cssc.h"
    2831#include "bodyio.h"
    2932#include "cssc-assert.h"
    3033
  • src/environment.cc

    diff --git a/src/environment.cc b/src/environment.cc
    index 425766a..6f0c5d3 100644
    a b  
    2222 * sections "Environment" and "Interoperability" in the CSSC manual.
    2323 *
    2424 */
     25#include "config.h"
     26
     27#include <cerrno>
     28#include <cstdio>
    2529#include <cstdlib>
    2630#include <cstring>
    27 #include <cstdio>
    28 #include <cerrno>
    29 
    30 #include "cssc.h"
    31 
    3231#include <limits.h>
    3332
     33#include "cssc.h"
    3434
    3535bool binary_file_creation_allowed (void)
    3636{
  • src/fatalsig.cc

    diff --git a/src/fatalsig.cc b/src/fatalsig.cc
    index 04835b1..b0333f1 100644
    a b  
    2222 * Handle fatal signals...
    2323 *
    2424 */
     25#include "config.h"
     26
    2527#include <cstdlib>
     28#include <signal.h>             /* TODO: consider using sigaction(). */
    2629
     30#include "cssc-assert.h"
    2731#include "cssc.h"
    28 #include "version.h"
    2932#include "quit.h"
    30 
    31 #include <signal.h>             /* TODO: consider using sigaction(). */
    32 #include "cssc-assert.h"
     33#include "version.h"
    3334
    3435
    3536/* The expansion of RETSIGTYPE is automatically decided by the configure
  • src/fdclosed.cc

    diff --git a/src/fdclosed.cc b/src/fdclosed.cc
    index f653d01..85687d5 100644
    a b  
    3131 * the file pointer on our file too).
    3232 */
    3333
    34 #include "cssc.h"
    35 #include "sysdep.h"
    36 #include "defaults.h"           // CONFIG_NULL_FILENAME
     34#include <config.h>
    3735
    3836#include <unistd.h>
    3937#include <stdio.h>              /* perror() */
    4038
     39#include "cssc.h"
     40#include "sysdep.h"
     41#include "defaults.h"           // CONFIG_NULL_FILENAME
    4142
    4243class SafeFdCheck
    4344{
  • src/file.cc

    diff --git a/src/file.cc b/src/file.cc
    index c2c4512..8821de0 100644
    a b  
    2323 * System dependent routines for accessing files.
    2424 *
    2525 */
     26#include "config.h"
     27
    2628#include <errno.h>
     29#include <sys/types.h>
     30#include <sys/stat.h>
     31#include <unistd.h>
     32#include <stdio.h>
     33#include <stdlib.h>
    2734
    28 #include "cssc.h"
     35#include "cssc.h"               /* for CONFIG_CAN_HARD_LINK_AN_OPEN_FILE */
    2936#include "cssc-assert.h"
    3037#include "sysdep.h"
    3138#include "file.h"
    3239#include "quit.h"
    3340#include "ioerr.h"
    3441#include "defaults.h"
    35 
    36 #include <unistd.h>
    37 #include <sys/stat.h>
    38 #include <stdio.h>
    3942#include "dirent-safer.h"
    4043
    4144/* Redirects stdout to a "null" file (eg. /dev/null). */
     
    152155
    153156
    154157
     158static int unprivileged = 0;
     159
    155160#ifdef CONFIG_UIDS
    156161
    157162/* A flag to indicate whether or not the programme is an privileged
    158163   (effective UID != real UID) or unprivileged (effective UID == real
    159164   UID). */
    160165
    161 static int unprivileged = 0;
    162 
    163166#ifdef SAVED_IDS_OK
    164167
    165168static uid_t old_euid;
  • src/file.h

    diff --git a/src/file.h b/src/file.h
    index 34292fc..293d2f4 100644
    a b  
    3333#include <sys/types.h>
    3434
    3535#include "filelock.h"
     36#include "mystring.h"
    3637
    3738enum create_mode {
    3839        CREATE_EXCLUSIVE     =  001,
  • src/filelock.h

    diff --git a/src/filelock.h b/src/filelock.h
    index bbd37df..3119a35 100644
    a b  
    2828#define CSSC__FILELOCK_H__
    2929
    3030#include "cleanup.h"
     31#include "mystring.h"
    3132
    3233class file_lock : private cleanup {
    3334        int locked;
  • src/fnsplit.cc

    diff --git a/src/fnsplit.cc b/src/fnsplit.cc
    index deed952..26da763 100644
    a b  
    2020 * Functions for canonifying filenames.
    2121 */
    2222
     23#include <config.h>
     24
    2325#include "cssc.h"
    2426#include "mystring.h"
    2527#include "file.h"               // declaration of split_filename.
  • src/get.cc

    diff --git a/src/get.cc b/src/get.cc
    index dffafba..de644f1 100644
    a b  
    2323 * Extract a requested delta from a SCCS file.
    2424 *
    2525 */
     26#include "config.h"
     27
    2628#include <errno.h>
    2729
    2830#include "cssc.h"
  • src/l-split.cc

    diff --git a/src/l-split.cc b/src/l-split.cc
    index 00712de..1aa2dc4 100644
    a b  
    2424 *
    2525 */
    2626
     27#include <config.h>
     28
    2729#include "cssc.h"
    2830#include "mylist.h"
    2931#include "sccsfile.h"           // declares these functions.
  • src/linebuf.cc

    diff --git a/src/linebuf.cc b/src/linebuf.cc
    index 822d97d..af6f04b 100644
    a b  
    2323 * Members of the class cssc_linebuf.
    2424 *
    2525 */
     26#include "config.h"
     27
    2628#include <cstdio>
    2729#include <cstring>
    2830#include <climits>
  • src/pf-add.cc

    diff --git a/src/pf-add.cc b/src/pf-add.cc
    index fa441b3..293ff03 100644
    a b  
    2323 *
    2424 */
    2525
     26#include <config.h>
     27
    2628#include "cssc.h"
    2729#include "pfile.h"
    2830#include "except.h"
  • src/pf-del.cc

    diff --git a/src/pf-del.cc b/src/pf-del.cc
    index 8d13da8..9e9c078 100644
    a b  
    2424 * a p-file.
    2525 *
    2626 */
     27#include "config.h"
     28
    2729#include <utility>
    2830
    2931#include "cssc.h"
  • src/pfile.cc

    diff --git a/src/pfile.cc b/src/pfile.cc
    index 7bb5989..8c10d70 100644
    a b  
    2323 * Common members of the class sccs_pfile.
    2424 *
    2525 */
     26#include "config.h"
     27
    2628#include <errno.h>
    2729
    2830#include "cssc.h"
  • src/prompt.cc

    diff --git a/src/prompt.cc b/src/prompt.cc
    index 69eb744..92fcce6 100644
    a b  
    2424 *
    2525 */
    2626
     27#include "config.h"
     28
    2729#include <cstdio>
    2830#include <cstring>
    2931#include <cstdio>
  • src/prs.cc

    diff --git a/src/prs.cc b/src/prs.cc
    index b4c4bdb..5f1edbb 100644
    a b  
    2424 *
    2525 */
    2626
     27#include <config.h>
    2728#include "cssc.h"
    2829#include "fileiter.h"
    2930#include "sccsfile.h"
  • src/prt.cc

    diff --git a/src/prt.cc b/src/prt.cc
    index 9ed915d..3856734 100644
    a b  
    2626 */
    2727
    2828
     29#include <config.h>
    2930#include "cssc.h"
    3031#include "fileiter.h"
    3132#include "sccsfile.h"
  • src/quit.cc

    diff --git a/src/quit.cc b/src/quit.cc
    index ac64c1c..0f602a9 100644
    a b  
    2323 * Functions for cleaning up and quitting.
    2424 *
    2525 */
     26#include "config.h"
     27
    2628#include <cstdio>
    2729#include <cstring>
    2830#include <cerrno>
  • src/rel_list.cc

    diff --git a/src/rel_list.cc b/src/rel_list.cc
    index a9f837b..d367668 100644
    a b  
    2020 * placed in the Public Domain.
    2121 *
    2222 */
     23#include "config.h"
    2324#include <cstdlib>
    2425
    2526#include "cssc.h"
  • src/rl-merge.cc

    diff --git a/src/rl-merge.cc b/src/rl-merge.cc
    index ea78e51..e129327 100644
    a b  
    2222 *
    2323 */
    2424
     25#include <config.h>
    2526#include "cssc.h"
    2627#include "rel_list.h"
    2728
  • src/rmdel.cc

    diff --git a/src/rmdel.cc b/src/rmdel.cc
    index ecc4e07..c839446 100644
    a b  
    2525 *
    2626 */
    2727
     28#include <config.h>
    2829#include "cssc.h"
    2930#include "fileiter.h"
    3031#include "sccsfile.h"
  • src/run.cc

    diff --git a/src/run.cc b/src/run.cc
    index d298846..0932687 100644
    a b  
    2424 * Routines for running programmes.
    2525 *
    2626 */
     27#include "config.h"
     28
    2729#include <cstdio>
    2830#include <errno.h>
    2931
  • src/sact.cc

    diff --git a/src/sact.cc b/src/sact.cc
    index 9ba7cbf..90ebe08 100644
    a b  
    2525 *
    2626 */
    2727
     28#include <config.h>
    2829#include "cssc.h"
    2930#include "fileiter.h"
    3031#include "pfile.h"
  • src/sccs-delta.cc

    diff --git a/src/sccs-delta.cc b/src/sccs-delta.cc
    index c4d6222..098ee1d 100644
    a b  
    2525 *
    2626 */
    2727
     28#include <config.h>
    2829#include "cssc.h"
    2930#include "sccsfile.h"
    3031#include "delta.h"
  • src/sccsdate.cc

    diff --git a/src/sccsdate.cc b/src/sccsdate.cc
    index 9b79b89..433a2fe 100644
    a b  
    2424 * Members of the class sccs_date.
    2525 *
    2626 */
     27#include <config.h>
    2728#include <cstring>
    2829
    2930#include "cssc.h"
  • src/sccsfile.cc

    diff --git a/src/sccsfile.cc b/src/sccsfile.cc
    index d698509..6cb211d 100644
    a b  
    2525 * the members in this file are used to read from the SCCS file.
    2626 *
    2727 */
     28#include <config.h>
    2829#include <errno.h>
    2930
    3031#include "cssc.h"
  • src/sccsname.cc

    diff --git a/src/sccsname.cc b/src/sccsname.cc
    index ef61b41..81edc54 100644
    a b  
    2525 *
    2626 */
    2727
     28#include <config.h>
    2829#include "cssc.h"
    2930#include "sccsname.h"
    3031#include "cssc-assert.h"
  • src/seqstate.cc

    diff --git a/src/seqstate.cc b/src/seqstate.cc
    index 61ae27a..ccdafb0 100644
    a b  
    2121 *
    2222 */
    2323
     24#include <config.h>
    2425#include "cssc.h"
    2526#include "seqstate.h"
    2627
  • src/sf-add.cc

    diff --git a/src/sf-add.cc b/src/sf-add.cc
    index cbda552..113d484 100644
    a b  
    2626 *
    2727 */
    2828
     29#include <config.h>
    2930#include "cssc.h"
    3031#include "sccsfile.h"
    3132#include "delta.h"
  • src/sf-admin.cc

    diff --git a/src/sf-admin.cc b/src/sf-admin.cc
    index de64a68..1bc94cd 100644
    a b  
    2626 *
    2727 */
    2828
     29#include <config.h>
    2930#include "cssc.h"
    3031#include "sccsfile.h"
    3132#include "sl-merge.h"
  • src/sf-cdc.cc

    diff --git a/src/sf-cdc.cc b/src/sf-cdc.cc
    index 88e2f15..8a3c804 100644
    a b  
    2626 *
    2727 */
    2828
     29#include <config.h>
    2930#include "cssc.h"
    3031#include "sccsfile.h"
    3132#include "delta.h"
  • src/sf-chkid.cc

    diff --git a/src/sf-chkid.cc b/src/sf-chkid.cc
    index bd649b1..e6e9f02 100644
    a b  
    2323 *
    2424 */
    2525
     26#include <config.h>
     27
     28#include <string.h>
     29
    2630#include "cssc.h"
    2731#include "sccsfile.h"
    2832#include "linebuf.h"
    2933#include "bodyio.h"
    3034
    31 #include <string.h>
    32 
    3335bool
    3436is_id_keyword_letter(char ch)
    3537{
  • src/sf-delta.cc

    diff --git a/src/sf-delta.cc b/src/sf-delta.cc
    index 286b44f..f2317af 100644
    a b  
    2525 * Members of sccs_file for adding a delta to the SCCS file.
    2626 *
    2727 */
     28#include <config.h>
     29
    2830#include <errno.h>
     31#include <unistd.h>
    2932
    3033#include "cssc.h"
    3134#include "sccsfile.h"
     
    4346
    4447#undef JAY_DEBUG
    4548
    46 #include <unistd.h>
    47 
    48 
    4949
    5050class diff_state
    5151{
  • src/sf-get.cc

    diff --git a/src/sf-get.cc b/src/sf-get.cc
    index 2f0c104..6001ba5 100644
    a b  
    2626 *
    2727 */
    2828
     29#include <config.h>
     30
    2931#include "cssc.h"
    3032#include "sccsfile.h"
    3133#include "pfile.h"
  • src/sf-get2.cc

    diff --git a/src/sf-get2.cc b/src/sf-get2.cc
    index 24831f9..7f970b4 100644
    a b  
    2525 *
    2626 */
    2727
     28#include <config.h>
     29
     30#include <ctype.h>
     31
    2832#include "cssc.h"
    2933#include "sccsfile.h"
    3034#include "pfile.h"
     
    3337#include "delta-table.h"
    3438
    3539
    36 #include <ctype.h>
    37 
    3840bool sccs_file::sid_matches(const sid& requested,
    3941                            const sid& found,
    4042                            bool get_top_delta) const
  • src/sf-get3.cc

    diff --git a/src/sf-get3.cc b/src/sf-get3.cc
    index e066675..9c7ef88 100644
    a b  
    2525 *
    2626 */
    2727
     28#include <config.h>
     29
    2830#include "cssc.h"
    2931#include "sccsfile.h"
    3032#include "seqstate.h"
  • src/sf-kw.cc

    diff --git a/src/sf-kw.cc b/src/sf-kw.cc
    index 97e5942..33ad58f 100644
    a b  
    2121 * sccs_file::no_id_keywords()
    2222 */
    2323
     24#include <config.h>
     25
    2426#include "cssc.h"
    2527#include "sccsfile.h"
    2628#include "except.h"
  • src/sf-prs.cc

    diff --git a/src/sf-prs.cc b/src/sf-prs.cc
    index 9b451b5..43745f3 100644
    a b  
    2727 *
    2828 */
    2929
     30#include <config.h>
     31
    3032#include "cssc.h"
    3133#include "sccsfile.h"
    3234#include "seqstate.h"
  • src/sf-prt.cc

    diff --git a/src/sf-prt.cc b/src/sf-prt.cc
    index 41b7b92..1d6c4e7 100644
    a b  
    2424 */
    2525
    2626
     27#include <config.h>
     28
    2729#include "cssc.h"
    2830#include "sccsfile.h"
    2931#include "seqstate.h"
  • src/sf-rmdel.cc

    diff --git a/src/sf-rmdel.cc b/src/sf-rmdel.cc
    index 9b1992f..a99b4d2 100644
    a b  
    2626 *
    2727 */
    2828
     29#include <config.h>
     30
    2931#include "cssc.h"
    3032#include "sccsfile.h"
    3133#include "delta.h"
  • src/sf-val.cc

    diff --git a/src/sf-val.cc b/src/sf-val.cc
    index 2e34efd..5b3474b 100644
    a b  
    2222 * Members of class sccs_file used by "val".
    2323 *
    2424 */
     25#include <config.h>
     26
    2527#include <vector>
     28
    2629#include "cssc.h"
    2730#include "sccsfile.h"
    2831#include "delta.h"
  • src/sf-write.cc

    diff --git a/src/sf-write.cc b/src/sf-write.cc
    index 74c2d31..6433f26 100644
    a b  
    2626 *
    2727 */
    2828
     29#include <config.h>
     30
    2931#include "cssc.h"
    3032#include "sccsfile.h"
    3133#include "delta.h"
  • src/sid.cc

    diff --git a/src/sid.cc b/src/sid.cc
    index 400cda1..99a31ce 100644
    a b  
    2525 *
    2626 */
    2727
     28#include <config.h>
     29
     30#include <ctype.h>
     31
    2832#include "cssc.h"
    2933#include "sid.h"
    3034#include "ioerr.h"
    3135
    32 #include <ctype.h>
    33 
    3436mystring sid::as_string() const
    3537{
    3638  char buf[32];
  • src/unget.cc

    diff --git a/src/unget.cc b/src/unget.cc
    index c6a21d5..38bb012 100644
    a b  
    2525 *
    2626 */
    2727
     28#include <config.h>
     29
    2830#include "cssc.h"
    2931#include "fileiter.h"
    3032#include "pfile.h"
  • src/val.cc

    diff --git a/src/val.cc b/src/val.cc
    index ccf6a2b..87ab911 100644
    a b  
    2121 *
    2222 */
    2323
     24#include <config.h>
     25
    2426#include "cssc.h"
    2527#include "fileiter.h"
    2628#include "sccsfile.h"
  • src/writesubst.cc

    diff --git a/src/writesubst.cc b/src/writesubst.cc
    index c4cdde6..38b512a 100644
    a b  
    2222 *
    2323 */
    2424
     25#include <config.h>
     26
    2527#include "cssc.h"
    2628#include "sccsfile.h"
    2729#include "delta.h"