home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-07-11 | 39.0 KB | 1,557 lines |
- Newsgroups: comp.unix.sysv386,alt.sources
- From: eric@egsner.cirr.com (Eric Schnoebelen)
- Subject: cvs patches for System V release 3.2 (was: rcs and cvs)
- Date: Thu, 11 Jul 91 03:57:14 GMT
- Message-ID: <1991Jul11.035714.28526@egsner.cirr.com>
-
- Well, here they are. The patches to allow cvs to build and run under
- System V/386 (specifically, ISC 2.0.2). They are based upon the cvs-1.2
- sources available on prep.ai.mit.edu, the Free Software Foundations home
- machine.
-
- Also needed to build cvs is gdbm, also from the Free Software Foundation.
-
- But, before applying the patches, the following commands will need to be
- executed in the cvs-1.2 directory. The reason for this is that Brian
- Berliner, being on a BSD based machine, named a number of files with
- names longer that fourteen characters. The following commands rename
- the files with too long of names to something less than twelve
- characters (so cvs/rcs can handle them). The commands are:
-
- mv man/mkmodules.man man/mkmod.man
- mv src/build_entry.c src/build_ent.c
- mv src/collect_sets.c src/coll_sets.c
- mv src/create_admin.c src/creat_adm.c
- mv src/entries_file.c src/entr_file.c
- mv src/name_repository.c src/name_repos.c
- mv src/no_difference.c src/no_diff.c
- mv src/scratch_entry.c src/scratch_en.c
- mv src/version_number.c src/vers_num.c
-
- The following patches generated with 'cvs patch', except for
- src/misc.c and src/regexp.c.
-
- Apply with patch -l -p0
-
- cvs patch: Examining examples
- diff -c Makefile:1.1.1.4 tools/Makefile:1.2
- *** Makefile:1.1.1.4 Wed Jul 10 22:00:36 1991
- --- Makefile Wed Jul 10 22:00:36 1991
- ***************
- *** 1,12 ****
- #
- ! # $Id: Makefile,v 1.1.1.4 91/03/03 21:59:31 eric Exp $
- #
- # Master Makefile for CVS
- #
-
- DESTDIR= /usr/local/bin
- CFLAGS= -O # -g
- ! LDFLAGS= # -Bstatic
- SUBDIRS= doc examples man src
-
- FILES= README Makefile COPYING
- --- 1,13 ----
- #
- ! # $Id: Makefile,v 1.2 91/03/04 02:59:06 eric Exp $
- #
- # Master Makefile for CVS
- #
- + SHELL=/bin/sh
-
- DESTDIR= /usr/local/bin
- CFLAGS= -O # -g
- ! LDFLAGS= -lbsd # -Bstatic
- SUBDIRS= doc examples man src
-
- FILES= README Makefile COPYING
- cvs patch: Examining src
- diff -c src/Makefile:1.1.1.4 tools/src/Makefile:1.2
- *** src/Makefile:1.1.1.4 Wed Jul 10 22:00:53 1991
- --- src/Makefile Wed Jul 10 22:00:53 1991
- ***************
- *** 1,19 ****
- #
- ! # $Id: Makefile,v 1.1.1.4 91/03/03 22:00:42 eric Exp $
- #
- # Makefile for CVS
- #
- ! COMMONSRCS= subr.c
- COMMONOBJS= ${COMMONSRCS:.c=.o}
-
- CVS= cvs
- CVSSRCS= add.c build_ent.c checkin.c checkout.c coll_sets.c\
- ! commit.c create_admin.c diff.c entr_file.c\
- find_names.c join.c locate_rcs.c log.c main.c\
- maketime.c modules.c name_repos.c no_diff.c\
- options.c partime.c patch.c register.c remove.c\
- scratch_en.c set_lock.c status.c tag.c update.c\
- ! vers_num.c version_ts.c
- CVSOBJS= ${CVSSRCS:.c=.o} ${COMMONOBJS}
-
- MOD= mkmodules
- --- 1,21 ----
- #
- ! # $Id: Makefile,v 1.2 91/03/04 03:07:08 eric Exp $
- #
- # Makefile for CVS
- #
- ! SHELL= /bin/sh
- ! COMMONSRCS= subr.c misc.c
- COMMONOBJS= ${COMMONSRCS:.c=.o}
-
- CVS= cvs
- CVSSRCS= add.c build_ent.c checkin.c checkout.c coll_sets.c\
- ! commit.c creat_adm.c diff.c entr_file.c\
- find_names.c join.c locate_rcs.c log.c main.c\
- maketime.c modules.c name_repos.c no_diff.c\
- options.c partime.c patch.c register.c remove.c\
- scratch_en.c set_lock.c status.c tag.c update.c\
- ! vers_num.c version_ts.c regex.c
- !
- CVSOBJS= ${CVSSRCS:.c=.o} ${COMMONOBJS}
-
- MOD= mkmodules
- ***************
- *** 31,38 ****
- FILES= Makefile ${HEADERS} ${ALLSRCS} ${CSHELLS}
-
- PROGS= ${CVS} ${MOD}
- ! CFLAGS= -O # -g
- LDFLAGS= # -Bstatic
-
- ETAGS= /usr/local/bin/etags
- CTAGS= ctags
- --- 33,41 ----
- FILES= Makefile ${HEADERS} ${ALLSRCS} ${CSHELLS}
-
- PROGS= ${CVS} ${MOD}
- ! CFLAGS= -O -DS5r3
- LDFLAGS= # -Bstatic
- + LIBS= -lndbm -lc_s
-
- ETAGS= /usr/local/bin/etags
- CTAGS= ctags
- ***************
- *** 40,54 ****
- all: ${PROGS}
-
- ${CVS}: ${CVSOBJS}
- ! ${CC} -o ${CVS} ${CFLAGS} ${CVSOBJS} ${LDFLAGS}
-
- ${MOD}: ${MODOBJS}
- ! ${CC} -o ${MOD} ${CFLAGS} ${MODOBJS} ${LDFLAGS}
-
- install: ${PROGS}
- ! install -m 755 ${PROGS} ${DESTDIR}
- for i in ${CSHELLS}; do\
- ! install -m 755 $$i ${DESTDIR}/`basename $$i ${CSHEXT}`;\
- done
-
- clean:
- --- 43,59 ----
- all: ${PROGS}
-
- ${CVS}: ${CVSOBJS}
- ! ${CC} -o ${CVS} ${CFLAGS} ${CVSOBJS} ${LDFLAGS} ${LIBS}
-
- ${MOD}: ${MODOBJS}
- ! ${CC} -o ${MOD} ${CFLAGS} ${MODOBJS} ${LDFLAGS} ${LIBS}
-
- install: ${PROGS}
- ! for i in ${PROGS} ; do \
- ! install -c -m 755 $$i ${DESTDIR} ;\
- ! done
- for i in ${CSHELLS}; do\
- ! install -c -m 755 $$i ${DESTDIR}/`basename $$i ${CSHEXT}`;\
- done
-
- clean:
- diff -c src/add.c:1.1.1.4 tools/src/add.c:1.3
- *** src/add.c:1.1.1.4 Wed Jul 10 22:00:55 1991
- --- src/add.c Wed Jul 10 22:00:55 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: add.c,v 1.1.1.4 91/03/03 22:00:45 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: add.c,v 1.3 91/03/04 11:35:37 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -c src/build_ent.c:1.1.1.3 tools/src/build_ent.c:1.3
- *** src/build_ent.c:1.1.1.3 Wed Jul 10 22:00:56 1991
- --- src/build_ent.c Wed Jul 10 22:00:56 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: build_ent.c,v 1.1.1.3 91/03/03 22:00:48 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: build_ent.c,v 1.3 91/03/04 11:35:39 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -c src/checkin.c:1.1.1.3 tools/src/checkin.c:1.3
- *** src/checkin.c:1.1.1.3 Wed Jul 10 22:00:58 1991
- --- src/checkin.c Wed Jul 10 22:00:59 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: checkin.c,v 1.1.1.3 91/03/03 22:00:51 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: checkin.c,v 1.3 91/03/04 11:35:41 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -c src/checkin.csh:1.1.1.3 tools/src/checkin.csh:1.2
- *** src/checkin.csh:1.1.1.3 Wed Jul 10 22:01:00 1991
- --- src/checkin.csh Wed Jul 10 22:01:01 1991
- ***************
- *** 1,6 ****
- #!/bin/csh
- #
- ! # $Id: checkin.csh,v 1.1.1.3 91/03/03 22:00:55 eric Exp $
- #
- # Copyright (c) 1989, Brian Berliner
- #
- --- 1,6 ----
- #!/bin/csh
- #
- ! # $Id: checkin.csh,v 1.2 91/03/04 03:07:18 eric Exp $
- #
- # Copyright (c) 1989, Brian Berliner
- #
- ***************
- *** 44,49 ****
- --- 44,53 ----
- set message_file = /tmp/checkin.$$
- set got_one = 0
-
- + if ( $?RCSBIN ) then
- + set rcsbin=$RCSBIN
- + endif
- +
- if ( $#argv < 3 ) then
- echo "Usage: checkin [-v] [-m message] [-f message_file] repository"
- echo " Vendor_Tag Vendor_Release_Tag [Vendor_Release_tag...]"
- ***************
- *** 94,100 ****
- if ( $?EDITOR ) then
- $EDITOR $message_file > /dev/tty
- else
- ! /usr/ucb/vi $message_file > /dev/tty
- endif
- set got_one = 1
- endif
- --- 98,104 ----
- if ( $?EDITOR ) then
- $EDITOR $message_file > /dev/tty
- else
- ! /usr/bin/vi $message_file > /dev/tty
- endif
- set got_one = 1
- endif
- diff -c src/checkout.c:1.1.1.3 tools/src/checkout.c:1.3
- *** src/checkout.c:1.1.1.3 Wed Jul 10 22:01:03 1991
- --- src/checkout.c Wed Jul 10 22:01:03 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: checkout.c,v 1.1.1.3 91/03/03 22:00:58 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: checkout.c,v 1.3 91/03/04 11:35:44 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -c src/coll_sets.c:1.1.1.3 tools/src/coll_sets.c:1.3
- *** src/coll_sets.c:1.1.1.3 Wed Jul 10 22:01:05 1991
- --- src/coll_sets.c Wed Jul 10 22:01:06 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: coll_sets.c,v 1.1.1.3 91/03/03 22:01:01 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: coll_sets.c,v 1.3 91/03/04 11:35:46 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -c src/commit.c:1.1.1.3 tools/src/commit.c:1.3
- *** src/commit.c:1.1.1.3 Wed Jul 10 22:01:09 1991
- --- src/commit.c Wed Jul 10 22:01:09 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: commit.c,v 1.1.1.3 91/03/03 22:01:05 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: commit.c,v 1.3 91/03/04 11:35:49 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 673,679 ****
- */
- #ifndef MAXHOSTNAMELEN
- #define MAXHOSTNAMELEN 64
- ! #endif !MAXHOSTNAMELEN
-
- /*
- * Writes some stuff to the logfile "filter" and returns the status of the
- --- 673,679 ----
- */
- #ifndef MAXHOSTNAMELEN
- #define MAXHOSTNAMELEN 64
- ! #endif /* !MAXHOSTNAMELEN */
-
- /*
- * Writes some stuff to the logfile "filter" and returns the status of the
- diff -c src/creat_adm.c:1.1.1.3 tools/src/creat_adm.c:1.3
- *** src/creat_adm.c:1.1.1.3 Wed Jul 10 22:01:12 1991
- --- src/creat_adm.c Wed Jul 10 22:01:12 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: creat_adm.c,v 1.1.1.3 91/03/03 22:01:09 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: creat_adm.c,v 1.3 91/03/04 11:35:52 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -c src/cvs.h:1.1.1.3 tools/src/cvs.h:1.2
- *** src/cvs.h:1.1.1.3 Wed Jul 10 22:01:14 1991
- --- src/cvs.h Wed Jul 10 22:01:15 1991
- ***************
- *** 1,8 ****
- ! /* $Id: cvs.h,v 1.1.1.3 91/03/03 22:01:12 eric Exp $ */
-
- #include <strings.h>
- #include <string.h>
- #include <stdio.h>
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,18 ----
- ! /* $Id: cvs.h,v 1.2 91/03/04 03:07:33 eric Exp $ */
-
- #include <strings.h>
- #include <string.h>
- #include <stdio.h>
- + #ifdef S5r3
- + # include <limits.h>
- + # define MAXPATHLEN PATH_MAX
- + # define USG 1
- + #endif
- + #if USG
- + # define bzero(addr, len) memset(addr, 0, len)
- + # define bcmp(addr1, addr2, len) memcmp(addr1, addr2, len)
- + # define bcopy(addr1, addr2, len) memcpy(addr1, addr2, len)
- + #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 36,45 ****
-
- /* support for the CVSROOTADM files */
- #define CVSMODULE_FILE "modules" /* last component of CVSROOTADM_MODULES */
- ! #define CVSMODULE_TMP ".#modules.XXXXXX"
- #define CVSMODULE_OPTS "ai:o:t:"
- #define CVSLOGINFO_FILE "loginfo" /* last component of CVSROOTADM_LOGINFO */
- ! #define CVSLOGINFO_TMP ".#loginfo.XXXXXX"
-
- /* Other CVS file names */
- #define CVSATTIC "Attic"
- --- 46,55 ----
-
- /* support for the CVSROOTADM files */
- #define CVSMODULE_FILE "modules" /* last component of CVSROOTADM_MODULES */
- ! #define CVSMODULE_TMP "cvsMXXXXXX"
- #define CVSMODULE_OPTS "ai:o:t:"
- #define CVSLOGINFO_FILE "loginfo" /* last component of CVSROOTADM_LOGINFO */
- ! #define CVSLOGINFO_TMP "cvsLXXXXXX"
-
- /* Other CVS file names */
- #define CVSATTIC "Attic"
- ***************
- *** 83,89 ****
- #define DATEFORM "%02d.%02d.%02d.%02d.%02d.%02d"
-
- /* Programs that cvs runs */
- ! #define DIFF "/bin/diff"
- #define GREP "/bin/grep"
- #define RM "/bin/rm"
- #define SORT "/usr/bin/sort"
- --- 93,99 ----
- #define DATEFORM "%02d.%02d.%02d.%02d.%02d.%02d"
-
- /* Programs that cvs runs */
- ! #define DIFF "/usr/local/bin/diff"
- #define GREP "/bin/grep"
- #define RM "/bin/rm"
- #define SORT "/usr/bin/sort"
- ***************
- *** 98,104 ****
- #define RCSBIN_DFLT "/usr/local/bin" /* directory to find RCS progs */
-
- #define EDITOR_ENV "EDITOR" /* which editor to use */
- ! #define EDITOR_DFLT "/usr/ucb/vi" /* somewhat standard */
-
- #define CVSROOT_ENV "CVSROOT" /* source directory root */
- #define CVSROOT_DFLT NULL /* No dflt; must set for checkout */
- --- 108,114 ----
- #define RCSBIN_DFLT "/usr/local/bin" /* directory to find RCS progs */
-
- #define EDITOR_ENV "EDITOR" /* which editor to use */
- ! #define EDITOR_DFLT "/usr/bin/vi" /* somewhat standard */
-
- #define CVSROOT_ENV "CVSROOT" /* source directory root */
- #define CVSROOT_DFLT NULL /* No dflt; must set for checkout */
- ***************
- *** 109,115 ****
- *
- * If the CVSROOT environment variable is set, it overrides this define.
- */
- ! #define REPOS_STRIP "/src/master/"
-
- /*
- * The maximum number of files per each CVS directory.
- --- 119,125 ----
- *
- * If the CVSROOT environment variable is set, it overrides this define.
- */
- ! #define REPOS_STRIP "/usr/acct/mastersrc/"
-
- /*
- * The maximum number of files per each CVS directory.
- ***************
- *** 157,164 ****
- --- 167,182 ----
- * Externs that are included in libc, but are used frequently
- * enough to warrant defining here.
- */
- + /*
- + * sprintf() returns an int under System V
- extern char *sprintf();
- + */
- extern char *optarg; /* for getopt() support */
- + #ifdef USG
- + extern char *getcwd();
- + #define getwd(c) getcwd((c), (MAXPATHLEN-2))
- + #else
- extern char *getwd();
- + #endif
- extern char *re_comp();
- extern int optind;
- diff -c src/diff.c:1.1.1.3 tools/src/diff.c:1.3
- *** src/diff.c:1.1.1.3 Wed Jul 10 22:01:16 1991
- --- src/diff.c Wed Jul 10 22:01:17 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: diff.c,v 1.1.1.3 91/03/03 22:01:15 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: diff.c,v 1.3 91/03/04 11:35:55 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -c src/entr_file.c:1.1.1.3 tools/src/entr_file.c:1.3
- *** src/entr_file.c:1.1.1.3 Wed Jul 10 22:01:18 1991
- --- src/entr_file.c Wed Jul 10 22:01:18 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: entr_file.c,v 1.1.1.3 91/03/03 22:01:19 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: entr_file.c,v 1.3 91/03/04 11:35:57 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -c src/find_names.c:1.1.1.3 tools/src/find_names.c:1.3
- *** src/find_names.c:1.1.1.3 Wed Jul 10 22:01:19 1991
- --- src/find_names.c Wed Jul 10 22:01:20 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: find_names.c,v 1.1.1.3 91/03/03 22:01:22 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: find_names.c,v 1.3 91/03/04 11:35:59 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -c src/join.c:1.1.1.3 tools/src/join.c:1.3
- *** src/join.c:1.1.1.3 Wed Jul 10 22:01:21 1991
- --- src/join.c Wed Jul 10 22:01:22 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: join.c,v 1.1.1.3 91/03/03 22:01:26 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: join.c,v 1.3 91/03/04 11:36:01 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -c src/locate_rcs.c:1.1.1.3 tools/src/locate_rcs.c:1.3
- *** src/locate_rcs.c:1.1.1.3 Wed Jul 10 22:01:26 1991
- --- src/locate_rcs.c Wed Jul 10 22:01:26 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: locate_rcs.c,v 1.1.1.3 91/03/03 22:01:29 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: locate_rcs.c,v 1.3 91/03/04 11:36:04 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -c src/log.c:1.1.1.3 tools/src/log.c:1.3
- *** src/log.c:1.1.1.3 Wed Jul 10 22:01:29 1991
- --- src/log.c Wed Jul 10 22:01:30 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: log.c,v 1.1.1.3 91/03/03 22:01:32 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: log.c,v 1.3 91/03/04 11:36:07 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -c src/mkmodules.c:1.1.1.3 tools/src/mkmodules.c:1.3
- *** src/mkmodules.c:1.1.1.3 Wed Jul 10 22:01:37 1991
- --- src/mkmodules.c Wed Jul 10 22:01:37 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: mkmodules.c,v 1.1.1.3 91/03/03 22:01:43 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: mkmodules.c,v 1.3 91/03/04 11:36:10 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 96,101 ****
- --- 96,105 ----
- return (0);
- }
-
- + #ifndef DBLKSIZ
- + #define DBLKSIZ 2048
- + #endif
- +
- static
- write_dbmfile(temp)
- char *temp;
- ***************
- *** 107,116 ****
- datum key, val;
- int len, cont, err = 0;
-
- fp = open_file(temp, "r");
- if ((db = dbm_open(temp, O_RDWR|O_CREAT|O_TRUNC, 0666)) == NULL)
- error(1, "cannot open dbm file %s for creation", temp);
- ! for (cont = 0; fgets(line, sizeof(line), fp) != NULL; ) {
- if ((cp = rindex(line, '\n')) != NULL)
- *cp = '\0'; /* strip the newline */
- /*
- --- 111,121 ----
- datum key, val;
- int len, cont, err = 0;
-
- +
- fp = open_file(temp, "r");
- if ((db = dbm_open(temp, O_RDWR|O_CREAT|O_TRUNC, 0666)) == NULL)
- error(1, "cannot open dbm file %s for creation", temp);
- ! for (cont = 0; fgets(line, DBLKSIZ, fp) != NULL; ) {
- if ((cp = rindex(line, '\n')) != NULL)
- *cp = '\0'; /* strip the newline */
- /*
- ***************
- *** 234,240 ****
- {
- #ifdef lint
- sig = sig;
- ! #endif lint
- }
-
- static
- --- 239,245 ----
- {
- #ifdef lint
- sig = sig;
- ! #endif /* lint */
- }
-
- static
- diff -c src/modules.c:1.1.1.3 tools/src/modules.c:1.3
- *** src/modules.c:1.1.1.3 Wed Jul 10 22:01:39 1991
- --- src/modules.c Wed Jul 10 22:01:40 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: modules.c,v 1.1.1.3 91/03/03 22:01:46 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: modules.c,v 1.3 91/03/04 11:36:13 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 23,32 ****
- * command line.
- */
-
- #include <sys/param.h>
- ! #include <sys/file.h>
- #include <ndbm.h>
- - #include "cvs.h"
-
- extern int update_build_dirs;
-
- --- 23,36 ----
- * command line.
- */
-
- + #include "cvs.h"
- #include <sys/param.h>
- ! #ifdef USG
- ! # include <sys/fcntl.h>
- ! #else
- ! # include <sys/file.h>
- ! #endif
- #include <ndbm.h>
-
- extern int update_build_dirs;
-
- diff -c src/name_repos.c:1.1.1.3 tools/src/name_repos.c:1.3
- *** src/name_repos.c:1.1.1.3 Wed Jul 10 22:01:41 1991
- --- src/name_repos.c Wed Jul 10 22:01:41 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: name_repos.c,v 1.1.1.3 91/03/03 22:01:49 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: name_repos.c,v 1.3 91/03/04 11:36:15 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -c src/no_diff.c:1.1.1.3 tools/src/no_diff.c:1.3
- *** src/no_diff.c:1.1.1.3 Wed Jul 10 22:01:42 1991
- --- src/no_diff.c Wed Jul 10 22:01:43 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: no_diff.c,v 1.1.1.3 91/03/03 22:01:52 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: no_diff.c,v 1.3 91/03/04 11:36:17 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -c src/options.c:1.1.1.3 tools/src/options.c:1.3
- *** src/options.c:1.1.1.3 Wed Jul 10 22:01:44 1991
- --- src/options.c Wed Jul 10 22:01:44 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: options.c,v 1.1.1.3 91/03/03 22:01:55 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: options.c,v 1.3 91/03/04 11:36:20 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -c src/patch.c:1.1.1.3 tools/src/patch.c:1.3
- *** src/patch.c:1.1.1.3 Wed Jul 10 22:01:50 1991
- --- src/patch.c Wed Jul 10 22:01:50 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: patch.c,v 1.1.1.3 91/03/03 22:02:03 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: patch.c,v 1.3 91/03/04 11:36:22 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 15,20 ****
- --- 15,21 ----
- * specify the release as either a date or a revision number.
- */
-
- + #include <sys/types.h>
- #include <sys/param.h>
- #include <time.h>
- #include <ndbm.h>
- ***************
- *** 21,26 ****
- --- 22,30 ----
- #include <dirent.h>
- #include <ctype.h>
- #include "cvs.h"
- + #ifdef USG
- + # include <signal.h>
- + #endif
-
- extern char update_dir[];
- extern DBM *open_module();
- diff -c src/register.c:1.1.1.3 tools/src/register.c:1.3
- *** src/register.c:1.1.1.3 Wed Jul 10 22:01:53 1991
- --- src/register.c Wed Jul 10 22:01:54 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: register.c,v 1.1.1.3 91/03/03 22:02:10 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: register.c,v 1.3 91/03/04 11:36:24 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -c src/remove.c:1.1.1.3 tools/src/remove.c:1.3
- *** src/remove.c:1.1.1.3 Wed Jul 10 22:01:55 1991
- --- src/remove.c Wed Jul 10 22:01:55 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: remove.c,v 1.1.1.3 91/03/03 22:02:12 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: remove.c,v 1.3 91/03/04 11:36:27 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -c src/scratch_en.c:1.1.1.3 tools/src/scratch_en.c:1.3
- *** src/scratch_en.c:1.1.1.3 Wed Jul 10 22:01:56 1991
- --- src/scratch_en.c Wed Jul 10 22:01:57 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: scratch_en.c,v 1.1.1.3 91/03/03 22:02:16 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: scratch_en.c,v 1.3 91/03/04 11:36:29 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 16,21 ****
- --- 16,25 ----
-
- #include <sys/param.h>
- #include "cvs.h"
- +
- + #ifndef MAX
- + #define MAX(a,b) ((a) > (b) ? (a) : (b))
- + #endif
-
- Scratch_Entry(fname)
- char *fname;
- diff -c src/set_lock.c:1.1.1.3 tools/src/set_lock.c:1.3
- *** src/set_lock.c:1.1.1.3 Wed Jul 10 22:01:58 1991
- --- src/set_lock.c Wed Jul 10 22:01:58 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: set_lock.c,v 1.1.1.3 91/03/03 22:02:19 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: set_lock.c,v 1.3 91/03/04 11:36:32 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -c src/status.c:1.1.1.3 tools/src/status.c:1.3
- *** src/status.c:1.1.1.3 Wed Jul 10 22:02:00 1991
- --- src/status.c Wed Jul 10 22:02:00 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: status.c,v 1.1.1.3 91/03/03 22:02:22 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: status.c,v 1.3 91/03/04 11:36:34 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -c src/subr.c:1.1.1.3 tools/src/subr.c:1.3
- *** src/subr.c:1.1.1.3 Wed Jul 10 22:02:02 1991
- --- src/subr.c Wed Jul 10 22:02:02 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: subr.c,v 1.1.1.3 91/03/03 22:02:25 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: subr.c,v 1.3 91/03/04 11:36:36 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 16,21 ****
- --- 16,25 ----
- #include <sys/file.h>
- #include <varargs.h>
- #include "cvs.h"
- + #ifdef USG
- + # include <sys/fcntl.h>
- + # include <unistd.h>
- + #endif
-
- /*
- * Send a "printf" format string to stderr and die, calling the
- ***************
- *** 239,251 ****
- /* Some UNIX distributions don't include these in their stat.h */
- #ifndef S_IWRITE
- #define S_IWRITE 0000200 /* write permission, owner */
- ! #endif !S_IWRITE
- #ifndef S_IWGRP
- #define S_IWGRP 0000020 /* write permission, grougroup */
- ! #endif !S_IWGRP
- #ifndef S_IWOTH
- #define S_IWOTH 0000002 /* write permission, other */
- ! #endif !S_IWOTH
-
- /*
- * Change the mode of a file, either adding write permissions, or
- --- 243,255 ----
- /* Some UNIX distributions don't include these in their stat.h */
- #ifndef S_IWRITE
- #define S_IWRITE 0000200 /* write permission, owner */
- ! #endif /* !S_IWRITE */
- #ifndef S_IWGRP
- #define S_IWGRP 0000020 /* write permission, grougroup */
- ! #endif /* !S_IWGRP */
- #ifndef S_IWOTH
- #define S_IWOTH 0000002 /* write permission, other */
- ! #endif /* !S_IWOTH */
-
- /*
- * Change the mode of a file, either adding write permissions, or
- diff -c src/tag.c:1.1.1.3 tools/src/tag.c:1.3
- *** src/tag.c:1.1.1.3 Wed Jul 10 22:02:04 1991
- --- src/tag.c Wed Jul 10 22:02:04 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: tag.c,v 1.1.1.3 91/03/03 22:02:29 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: tag.c,v 1.3 91/03/04 11:36:39 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 15,20 ****
- --- 15,21 ----
- */
-
- #include <sys/param.h>
- + #include <sys/types.h>
- #include <ndbm.h>
- #include <dirent.h>
- #include <ctype.h>
- diff -c src/update.c:1.1.1.3 tools/src/update.c:1.3
- *** src/update.c:1.1.1.3 Wed Jul 10 22:02:06 1991
- --- src/update.c Wed Jul 10 22:02:07 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: update.c,v 1.1.1.3 91/03/03 22:02:32 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: update.c,v 1.3 91/03/04 11:36:41 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -c src/vers_num.c:1.1.1.3 tools/src/vers_num.c:1.3
- *** src/vers_num.c:1.1.1.3 Wed Jul 10 22:02:09 1991
- --- src/vers_num.c Wed Jul 10 22:02:09 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: vers_num.c,v 1.1.1.3 91/03/03 22:02:37 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: vers_num.c,v 1.3 91/03/04 11:36:44 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- diff -c src/version_ts.c:1.1.1.3 tools/src/version_ts.c:1.3
- *** src/version_ts.c:1.1.1.3 Wed Jul 10 22:02:11 1991
- --- src/version_ts.c Wed Jul 10 22:02:11 1991
- ***************
- *** 1,6 ****
- #ifndef lint
- ! static char rcsid[] = "$Id: version_ts.c,v 1.1.1.3 91/03/03 22:02:40 eric Exp $";
- ! #endif !lint
-
- /*
- * Copyright (c) 1989, Brian Berliner
- --- 1,6 ----
- #ifndef lint
- ! static char rcsid[] = "$Id: version_ts.c,v 1.3 91/03/04 11:36:48 eric Exp $";
- ! #endif /* !lint */
-
- /*
- * Copyright (c) 1989, Brian Berliner
- ***************
- *** 93,105 ****
- /* Some UNIX distributions don't include these in their stat.h */
- #ifndef S_IWRITE
- #define S_IWRITE 0000200 /* write permission, owner */
- ! #endif !S_IWRITE
- #ifndef S_IWGRP
- #define S_IWGRP 0000020 /* write permission, grougroup */
- ! #endif !S_IWGRP
- #ifndef S_IWOTH
- #define S_IWOTH 0000002 /* write permission, other */
- ! #endif !S_IWOTH
-
- /*
- * Gets the time-stamp for the file "file" and puts it in the already
- --- 93,105 ----
- /* Some UNIX distributions don't include these in their stat.h */
- #ifndef S_IWRITE
- #define S_IWRITE 0000200 /* write permission, owner */
- ! #endif /* !S_IWRITE */
- #ifndef S_IWGRP
- #define S_IWGRP 0000020 /* write permission, grougroup */
- ! #endif /* !S_IWGRP */
- #ifndef S_IWOTH
- #define S_IWOTH 0000002 /* write permission, other */
- ! #endif /* !S_IWOTH */
-
- /*
- * Gets the time-stamp for the file "file" and puts it in the already
- diff -c /dev/null src/misc.c
- *** /dev/null Wed Jul 10 21:29:33 1991
- --- src/misc.c Wed Jul 10 13:11:29 1991
- ***************
- *** 0 ****
- --- 1,68 ----
- +
- + /*
- + * Copyright (c) 1991, Eric Schnoebelen
- + *
- + * You may distribute under the terms of the GNU General Public License
- + * as specified in the README file that comes with the CVS 1.0 kit.
- + *
- + * This is a file of miscelanous routines needed to make CVS compile
- + * under System V
- + *
- + * Eric Schnoebelen
- + * 03/01/91
- + */
- +
- + #include <sys/types.h>
- + #include "cvs.h"
- +
- + #ifdef USG
- + #include <sys/utsname.h>
- + #include <unistd.h>
- + #include <fcntl.h>
- + #include <stdio.h>
- + #include <errno.h>
- +
- + int
- + rename(from, to)
- + char *from, *to;
- + {
- + if (unlink(to) && errno != ENOENT)
- + return -1;
- + if (link(from,to))
- + return -1;
- + if (unlink(from))
- + return -1;
- + return 0;
- + }
- +
- + gethostname(name, namlen)
- + char *name;
- + int namlen;
- + {
- + int i;
- + struct utsname uts;
- + uname(&uts);
- +
- + i = strlen(uts.nodename) + 1;
- + (void) strncpy(name, uts.nodename, i < namlen ? i : namlen);
- + }
- +
- + int
- + mkstemp(template)
- + char *template;
- +
- + {
- + return(open(mktemp(template),O_RDWR|O_CREAT, 0666));
- + }
- +
- + int
- + setlinebuf(stream)
- + FILE *stream;
- + {
- + char *buf, *malloc();
- +
- + buf = malloc(BUFSIZ);
- + fflush(stream);
- + return setvbuf(stream, buf, _IOLBF, BUFSIZ);
- + }
- + #endif /* USG */
- diff -c /dev/null src/regex.c
- *** /dev/null Wed Jul 10 21:29:33 1991
- --- src/regex.c Wed Jul 10 13:11:38 1991
- ***************
- *** 0 ****
- --- 1,394 ----
- + /* @(#)regex.c 4.1 (Berkeley) 12/21/80 */
- +
- + /*
- + * routines to do regular expression matching
- + *
- + * Entry points:
- + *
- + * re_comp(s)
- + * char *s;
- + * ... returns 0 if the string s was compiled successfully,
- + * a pointer to an error message otherwise.
- + * If passed 0 or a null string returns without changing
- + * the currently compiled re (see note 11 below).
- + *
- + * re_exec(s)
- + * char *s;
- + * ... returns 1 if the string s matches the last compiled regular
- + * expression,
- + * 0 if the string s failed to match the last compiled
- + * regular expression, and
- + * -1 if the compiled regular expression was invalid
- + * (indicating an internal error).
- + *
- + * The strings passed to both re_comp and re_exec may have trailing or
- + * embedded newline characters; they are terminated by nulls.
- + *
- + * The identity of the author of these routines is lost in antiquity;
- + * this is essentially the same as the re code in the original V6 ed.
- + *
- + * The regular expressions recognized are described below. This description
- + * is essentially the same as that for ed.
- + *
- + * A regular expression specifies a set of strings of characters.
- + * A member of this set of strings is said to be matched by
- + * the regular expression. In the following specification for
- + * regular expressions the word `character' means any character but NUL.
- + *
- + * 1. Any character except a special character matches itself.
- + * Special characters are the regular expression delimiter plus
- + * \ [ . and sometimes ^ * $.
- + * 2. A . matches any character.
- + * 3. A \ followed by any character except a digit or ( )
- + * matches that character.
- + * 4. A nonempty string s bracketed [s] (or [^s]) matches any
- + * character in (or not in) s. In s, \ has no special meaning,
- + * and ] may only appear as the first letter. A substring
- + * a-b, with a and b in ascending ASCII order, stands for
- + * the inclusive range of ASCII characters.
- + * 5. A regular expression of form 1-4 followed by * matches a
- + * sequence of 0 or more matches of the regular expression.
- + * 6. A regular expression, x, of form 1-8, bracketed \(x\)
- + * matches what x matches.
- + * 7. A \ followed by a digit n matches a copy of the string that the
- + * bracketed regular expression beginning with the nth \( matched.
- + * 8. A regular expression of form 1-8, x, followed by a regular
- + * expression of form 1-7, y matches a match for x followed by
- + * a match for y, with the x match being as long as possible
- + * while still permitting a y match.
- + * 9. A regular expression of form 1-8 preceded by ^ (or followed
- + * by $), is constrained to matches that begin at the left
- + * (or end at the right) end of a line.
- + * 10. A regular expression of form 1-9 picks out the longest among
- + * the leftmost matches in a line.
- + * 11. An empty regular expression stands for a copy of the last
- + * regular expression encountered.
- + */
- +
- + /*
- + * constants for re's
- + */
- + #define CBRA 1
- + #define CCHR 2
- + #define CDOT 4
- + #define CCL 6
- + #define NCCL 8
- + #define CDOL 10
- + #define CEOF 11
- + #define CKET 12
- + #define CBACK 18
- +
- + #define CSTAR 01
- +
- + #define ESIZE 512
- + #define NBRA 9
- +
- + static char regex_expbuf[ESIZE], *regex_braslist[NBRA],
- + *regex_braelist[NBRA];
- + static char regex_circf;
- +
- + /*
- + * compile the regular expression argument into a dfa
- + */
- + char *
- + re_comp(sp)
- + register char *sp;
- + {
- + register int c;
- + register char *ep = regex_expbuf;
- + int cclcnt, numbra = 0;
- + char *lastep = 0;
- + char bracket[NBRA];
- + char *bracketp = &bracket[0];
- + /* this is read-only & needs no semaphoring; is static to save space */
- + static char *retoolong = "Regular expression too long";
- +
- + #define comerr(msg) {regex_expbuf[0] = 0; numbra = 0; return(msg); }
- +
- + if (sp == 0 || *sp == '\0') {
- + if (*ep == 0)
- + return("No previous regular expression");
- + return(0);
- + }
- + if (*sp == '^') {
- + regex_circf = 1;
- + sp++;
- + }
- + else
- + regex_circf = 0;
- + for (;;) {
- + if (ep >= ®ex_expbuf[ESIZE])
- + comerr(retoolong);
- + if ((c = *sp++) == '\0') {
- + if (bracketp != bracket)
- + comerr("unmatched \\(");
- + *ep++ = CEOF;
- + *ep++ = 0;
- + return(0);
- + }
- + if (c != '*')
- + lastep = ep;
- + switch (c) {
- +
- + case '.':
- + *ep++ = CDOT;
- + continue;
- +
- + case '*':
- + if (lastep == 0 || *lastep == CBRA || *lastep == CKET)
- + goto defchar;
- + *lastep |= CSTAR;
- + continue;
- +
- + case '$':
- + if (*sp != '\0')
- + goto defchar;
- + *ep++ = CDOL;
- + continue;
- +
- + case '[':
- + *ep++ = CCL;
- + *ep++ = 0;
- + cclcnt = 1;
- + if ((c = *sp++) == '^') {
- + c = *sp++;
- + ep[-2] = NCCL;
- + }
- + do {
- + if (c == '\0')
- + comerr("missing ]");
- + if (c == '-' && ep [-1] != 0) {
- + if ((c = *sp++) == ']') {
- + *ep++ = '-';
- + cclcnt++;
- + break;
- + }
- + while (ep[-1] < c) {
- + *ep = ep[-1] + 1;
- + ep++;
- + cclcnt++;
- + if (ep >= ®ex_expbuf[ESIZE])
- + comerr(retoolong);
- + }
- + }
- + *ep++ = c;
- + cclcnt++;
- + if (ep >= ®ex_expbuf[ESIZE])
- + comerr(retoolong);
- + } while ((c = *sp++) != ']');
- + lastep[1] = cclcnt;
- + continue;
- +
- + case '\\':
- + if ((c = *sp++) == '(') {
- + if (numbra >= NBRA)
- + comerr("too many \\(\\) pairs");
- + *bracketp++ = numbra;
- + *ep++ = CBRA;
- + *ep++ = numbra++;
- + continue;
- + }
- + if (c == ')') {
- + if (bracketp <= bracket)
- + comerr("unmatched \\)");
- + *ep++ = CKET;
- + *ep++ = *--bracketp;
- + continue;
- + }
- + if (c >= '1' && c < ('1' + NBRA)) {
- + *ep++ = CBACK;
- + *ep++ = c - '1';
- + continue;
- + }
- + *ep++ = CCHR;
- + *ep++ = c;
- + continue;
- +
- + defchar:
- + default:
- + *ep++ = CCHR;
- + *ep++ = c;
- + }
- + }
- + }
- +
- + /*
- + * match the argument string against the compiled re
- + */
- + int
- + re_exec(p1)
- + register char *p1;
- + {
- + register char *p2 = regex_expbuf;
- + register int c;
- + int rv;
- +
- + for (c = 0; c < NBRA; c++) {
- + regex_braslist[c] = 0;
- + regex_braelist[c] = 0;
- + }
- + if (regex_circf)
- + return((advance(p1, p2)));
- + /*
- + * fast check for first character
- + */
- + if (*p2 == CCHR) {
- + c = p2[1];
- + do {
- + if (*p1 != c)
- + continue;
- + if (rv = advance(p1, p2))
- + return(rv);
- + } while (*p1++);
- + return(0);
- + }
- + /*
- + * regular algorithm
- + */
- + do
- + if (rv = advance(p1, p2))
- + return(rv);
- + while (*p1++);
- + return(0);
- + }
- +
- + /*
- + * try to match the next thing in the dfa
- + */
- + static int
- + advance(lp, ep)
- + register char *lp, *ep;
- + {
- + register char *curlp;
- + int ct, i;
- + int rv;
- +
- + for (;;)
- + switch (*ep++) {
- +
- + case CCHR:
- + if (*ep++ == *lp++)
- + continue;
- + return(0);
- +
- + case CDOT:
- + if (*lp++)
- + continue;
- + return(0);
- +
- + case CDOL:
- + if (*lp == '\0')
- + continue;
- + return(0);
- +
- + case CEOF:
- + return(1);
- +
- + case CCL:
- + if (cclass(ep, *lp++, 1)) {
- + ep += *ep;
- + continue;
- + }
- + return(0);
- +
- + case NCCL:
- + if (cclass(ep, *lp++, 0)) {
- + ep += *ep;
- + continue;
- + }
- + return(0);
- +
- + case CBRA:
- + regex_braslist[*ep++] = lp;
- + continue;
- +
- + case CKET:
- + regex_braelist[*ep++] = lp;
- + continue;
- +
- + case CBACK:
- + if (regex_braelist[i = *ep++] == 0)
- + return(-1);
- + if (backref(i, lp)) {
- + lp += regex_braelist[i] - regex_braslist[i];
- + continue;
- + }
- + return(0);
- +
- + case CBACK|CSTAR:
- + if (regex_braelist[i = *ep++] == 0)
- + return(-1);
- + curlp = lp;
- + ct = regex_braelist[i] - regex_braslist[i];
- + while (backref(i, lp))
- + lp += ct;
- + while (lp >= curlp) {
- + if (rv = advance(lp, ep))
- + return(rv);
- + lp -= ct;
- + }
- + continue;
- +
- + case CDOT|CSTAR:
- + curlp = lp;
- + while (*lp++)
- + ;
- + goto star;
- +
- + case CCHR|CSTAR:
- + curlp = lp;
- + while (*lp++ == *ep)
- + ;
- + ep++;
- + goto star;
- +
- + case CCL|CSTAR:
- + case NCCL|CSTAR:
- + curlp = lp;
- + while (cclass(ep, *lp++, ep[-1] == (CCL|CSTAR)))
- + ;
- + ep += *ep;
- + goto star;
- +
- + star:
- + do {
- + lp--;
- + if (rv = advance(lp, ep))
- + return(rv);
- + } while (lp > curlp);
- + return(0);
- +
- + default:
- + return(-1);
- + }
- + }
- +
- + static
- + backref(i, lp)
- + register int i;
- + register char *lp;
- + {
- + register char *bp;
- +
- + bp = regex_braslist[i];
- + while (*bp++ == *lp++)
- + if (bp >= regex_braelist[i])
- + return(1);
- + return(0);
- + }
- +
- + static int
- + cclass(set, c, af)
- + register char *set, c;
- + int af;
- + {
- + register int n;
- +
- + if (c == 0)
- + return(0);
- + n = *set++;
- + while (--n)
- + if (*set++ == c)
- + return(af);
- + return(! af);
- + }
- --
- Eric Schnoebelen eric@cirr.com schnoebe@convex.com
- Q: What is small and yellow and very dangerous?
- A: A canary with the super-user password!
-