diff -Naur 4bsd-1.0/diff/diffdir.c 4bsd-test/diff/diffdir.c
--- 4bsd-1.0/diff/diffdir.c	2002-07-10 09:17:21.000000000 +0200
+++ 4bsd-test/diff/diffdir.c	2003-05-29 11:10:41.000000000 +0200
@@ -189,7 +189,7 @@
 	while (rp = readdir(dirp)) {
 		ep = &dp[nitems++];
 		ep->D_reclen = rp->d_reclen;
-		ep->D_namlen = rp->d_namlen;
+		//ep->D_namlen = rp->d_namlen;
 		ep->D_entry = 0;
 		ep->d_flags = 0;
 		if (ep->D_namlen > 0) {
diff -Naur 4bsd-1.0/diff/diffreg.c 4bsd-test/diff/diffreg.c
--- 4bsd-1.0/diff/diffreg.c	2002-07-10 09:17:21.000000000 +0200
+++ 4bsd-test/diff/diffreg.c	2003-05-29 11:16:12.000000000 +0200
@@ -1,5 +1,6 @@
 static	char sccsid[] = "@(#)diffreg.c 4.7 2/28/83";
 
+#define _GNU_SOURCE
 #include "diff.h"
 /*
  * diff - compare two files.
@@ -206,10 +207,10 @@
 	char buf[BUFSIZ];
 	register int i, f;
 
-	signal(SIGHUP,done);
-	signal(SIGINT,done);
-	signal(SIGPIPE,done);
-	signal(SIGTERM,done);
+	signal(SIGHUP,(sighandler_t)done);
+	signal(SIGINT,(sighandler_t)done);
+	signal(SIGPIPE,(sighandler_t)done);
+	signal(SIGTERM,(sighandler_t)done);
 	tempfile = mktemp("/tmp/dXXXXX");
 	f = creat(tempfile,0600);
 	if (f < 0) {
diff -Naur 4bsd-1.0/diff/Makefile 4bsd-test/diff/Makefile
--- 4bsd-1.0/diff/Makefile	2002-07-10 09:17:21.000000000 +0200
+++ 4bsd-test/diff/Makefile	2003-05-29 11:22:51.000000000 +0200
@@ -3,7 +3,7 @@
 DIFF=	/bin/diff
 DIFFH=	/usr/lib/diffh
 PR=	/bin/pr
-CFLAGS=	-g -DDIFF='"${DIFF}"' -DDIFFH='"${DIFFH}"' -DPR='"${PR}"'
+CFLAGS=-g -DDIFF='"${DIFF}"' -DDIFFH='"${DIFFH}"' -DPR='"${PR}"'
 DESTDIR=
 
 SRCS=	diff.c diffdir.c diffreg.c
diff -Naur 4bsd-1.0/egrep/egrep.1 4bsd-test/egrep/egrep.1
--- 4bsd-1.0/egrep/egrep.1	2002-07-10 09:17:21.000000000 +0200
+++ 4bsd-test/egrep/egrep.1	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-.so man1/grep.1
diff -Naur 4bsd-1.0/egrep/egrep.y 4bsd-test/egrep/egrep.y
--- 4bsd-1.0/egrep/egrep.y	2002-07-10 09:17:21.000000000 +0200
+++ 4bsd-test/egrep/egrep.y	1970-01-01 01:00:00.000000000 +0100
@@ -1,622 +0,0 @@
-/*
- * egrep -- print lines containing (or not containing) a regular expression
- *
- *	status returns:
- *		0 - ok, and some matches
- *		1 - ok, but no matches
- *		2 - some error
- */
-%token CHAR DOT CCL NCCL OR CAT STAR PLUS QUEST
-%left OR
-%left CHAR DOT CCL NCCL '('
-%left CAT
-%left STAR PLUS QUEST
-
-%{
-static char *sccsid = "@(#)egrep.y	4.4 (Berkeley) 5/29/85";
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#define BLKSIZE 8192
-#define MAXLIN 350
-#define MAXPOS 4000
-#define NCHARS 128
-#define NSTATES 128
-#define FINAL -1
-char gotofn[NSTATES][NCHARS];
-int state[NSTATES];
-char out[NSTATES];
-int line = 1;
-int name[MAXLIN];
-int left[MAXLIN];
-int right[MAXLIN];
-int parent[MAXLIN];
-int foll[MAXLIN];
-int positions[MAXPOS];
-char chars[MAXLIN];
-int nxtpos;
-int nxtchar = 0;
-int tmpstat[MAXLIN];
-int initstat[MAXLIN];
-int xstate;
-int count;
-int icount;
-char *input;
-FILE *exprfile;
-
-long	lnum;
-int	bflag;
-int	cflag;
-int	fflag;
-int	lflag;
-int	qflag;
-int	nflag;
-int	hflag	= 1;
-int	sflag;
-int	vflag;
-int	retcode = 0;
-int	nfile;
-int	blkno;
-long	tln;
-int	nsucc;
-
-int	f;
-char	*fname;
-%}
-
-%%
-s:	t
-		={ unary(FINAL, $1);
-		  line--;
-		}
-	;
-t:	b r
-		={ $$ = node(CAT, $1, $2); }
-	| OR b r OR
-		={ $$ = node(CAT, $2, $3); }
-	| OR b r
-		={ $$ = node(CAT, $2, $3); }
-	| b r OR
-		={ $$ = node(CAT, $1, $2); }
-	;
-b:
-		={ $$ = enter(DOT);
-		   $$ = unary(STAR, $$); }
-	;
-r:	CHAR
-		={ $$ = enter($1); }
-	| DOT
-		={ $$ = enter(DOT); }
-	| CCL
-		={ $$ = cclenter(CCL); }
-	| NCCL
-		={ $$ = cclenter(NCCL); }
-	;
-
-r:	r OR r
-		={ $$ = node(OR, $1, $3); }
-	| r r %prec CAT
-		={ $$ = node(CAT, $1, $2); }
-	| r STAR
-		={ $$ = unary(STAR, $1); }
-	| r PLUS
-		={ $$ = unary(PLUS, $1); }
-	| r QUEST
-		={ $$ = unary(QUEST, $1); }
-	| '(' r ')'
-		={ $$ = $2; }
-	| error 
-	;
-
-%%
-yyerror(s) {
-	fprintf(stderr, "egrep: %s\n", s);
-	exit(2);
-}
-
-yylex() {
-	extern int yylval;
-	int cclcnt, x;
-	register char c, d;
-	switch(c = nextch()) {
-		case '$':
-		case '^': c = '\n';
-			goto defchar;
-		case '|': return (OR);
-		case '*': return (STAR);
-		case '+': return (PLUS);
-		case '?': return (QUEST);
-		case '(': return (c);
-		case ')': return (c);
-		case '.': return (DOT);
-		case '\0': return (0);
-		case '\n': return (OR);
-		case '[': 
-			x = CCL;
-			cclcnt = 0;
-			count = nxtchar++;
-			if ((c = nextch()) == '^') {
-				x = NCCL;
-				c = nextch();
-			}
-			do {
-				if (c == '\0') synerror();
-				if (c == '-' && cclcnt > 0 && chars[nxtchar-1] != 0) {
-					if ((d = nextch()) != 0) {
-						c = chars[nxtchar-1];
-						while (c < d) {
-							if (nxtchar >= MAXLIN) overflo();
-							chars[nxtchar++] = ++c;
-							cclcnt++;
-						}
-						continue;
-					}
-				}
-				if (nxtchar >= MAXLIN) overflo();
-				chars[nxtchar++] = c;
-				cclcnt++;
-			} while ((c = nextch()) != ']');
-			chars[count] = cclcnt;
-			return (x);
-		case '\\':
-			if ((c = nextch()) == '\0') synerror();
-		defchar:
-		default: yylval = c; return (CHAR);
-	}
-}
-nextch() {
-	register char c;
-	if (fflag) {
-		if ((c = getc(exprfile)) == EOF) {
-			fclose(exprfile);
-			return(0);
-		}
-	}
-	else c = *input++;
-	return(c);
-}
-
-synerror() {
-	fprintf(stderr, "egrep: syntax error\n");
-	exit(2);
-}
-
-enter(x) int x; {
-	if(line >= MAXLIN) overflo();
-	name[line] = x;
-	left[line] = 0;
-	right[line] = 0;
-	return(line++);
-}
-
-cclenter(x) int x; {
-	register linno;
-	linno = enter(x);
-	right[linno] = count;
-	return (linno);
-}
-
-node(x, l, r) {
-	if(line >= MAXLIN) overflo();
-	name[line] = x;
-	left[line] = l;
-	right[line] = r;
-	parent[l] = line;
-	parent[r] = line;
-	return(line++);
-}
-
-unary(x, d) {
-	if(line >= MAXLIN) overflo();
-	name[line] = x;
-	left[line] = d;
-	right[line] = 0;
-	parent[d] = line;
-	return(line++);
-}
-overflo() {
-	fprintf(stderr, "egrep: regular expression too long\n");
-	exit(2);
-}
-
-cfoll(v) {
-	register i;
-	if (left[v] == 0) {
-		count = 0;
-		for (i=1; i<=line; i++) tmpstat[i] = 0;
-		follow(v);
-		add(foll, v);
-	}
-	else if (right[v] == 0) cfoll(left[v]);
-	else {
-		cfoll(left[v]);
-		cfoll(right[v]);
-	}
-}
-cgotofn() {
-	register c, i, k;
-	int n, s;
-	char symbol[NCHARS];
-	int j, nc, pc, pos;
-	int curpos, num;
-	int number, newpos;
-	count = 0;
-	for (n=3; n<=line; n++) tmpstat[n] = 0;
-	if (cstate(line-1)==0) {
-		tmpstat[line] = 1;
-		count++;
-		out[0] = 1;
-	}
-	for (n=3; n<=line; n++) initstat[n] = tmpstat[n];
-	count--;		/*leave out position 1 */
-	icount = count;
-	tmpstat[1] = 0;
-	add(state, 0);
-	n = 0;
-	for (s=0; s<=n; s++)  {
-		if (out[s] == 1) continue;
-		for (i=0; i<NCHARS; i++) symbol[i] = 0;
-		num = positions[state[s]];
-		count = icount;
-		for (i=3; i<=line; i++) tmpstat[i] = initstat[i];
-		pos = state[s] + 1;
-		for (i=0; i<num; i++) {
-			curpos = positions[pos];
-			if ((c = name[curpos]) >= 0) {
-				if (c < NCHARS) symbol[c] = 1;
-				else if (c == DOT) {
-					for (k=0; k<NCHARS; k++)
-						if (k!='\n') symbol[k] = 1;
-				}
-				else if (c == CCL) {
-					nc = chars[right[curpos]];
-					pc = right[curpos] + 1;
-					for (k=0; k<nc; k++) symbol[chars[pc++]] = 1;
-				}
-				else if (c == NCCL) {
-					nc = chars[right[curpos]];
-					for (j = 0; j < NCHARS; j++) {
-						pc = right[curpos] + 1;
-						for (k = 0; k < nc; k++)
-							if (j==chars[pc++]) goto cont;
-						if (j!='\n') symbol[j] = 1;
-						cont:;
-					}
-				}
-				else printf("something's funny\n");
-			}
-			pos++;
-		}
-		for (c=0; c<NCHARS; c++) {
-			if (symbol[c] == 1) { /* nextstate(s,c) */
-				count = icount;
-				for (i=3; i <= line; i++) tmpstat[i] = initstat[i];
-				pos = state[s] + 1;
-				for (i=0; i<num; i++) {
-					curpos = positions[pos];
-					if ((k = name[curpos]) >= 0)
-						if (
-							(k == c)
-							| (k == DOT)
-							| (k == CCL && member(c, right[curpos], 1))
-							| (k == NCCL && member(c, right[curpos], 0))
-						) {
-							number = positions[foll[curpos]];
-							newpos = foll[curpos] + 1;
-							for (k=0; k<number; k++) {
-								if (tmpstat[positions[newpos]] != 1) {
-									tmpstat[positions[newpos]] = 1;
-									count++;
-								}
-								newpos++;
-							}
-						}
-					pos++;
-				} /* end nextstate */
-				if (notin(n)) {
-					if (n >= NSTATES) overflo();
-					add(state, ++n);
-					if (tmpstat[line] == 1) out[n] = 1;
-					gotofn[s][c] = n;
-				}
-				else {
-					gotofn[s][c] = xstate;
-				}
-			}
-		}
-	}
-}
-
-cstate(v) {
-	register b;
-	if (left[v] == 0) {
-		if (tmpstat[v] != 1) {
-			tmpstat[v] = 1;
-			count++;
-		}
-		return(1);
-	}
-	else if (right[v] == 0) {
-		if (cstate(left[v]) == 0) return (0);
-		else if (name[v] == PLUS) return (1);
-		else return (0);
-	}
-	else if (name[v] == CAT) {
-		if (cstate(left[v]) == 0 && cstate(right[v]) == 0) return (0);
-		else return (1);
-	}
-	else { /* name[v] == OR */
-		b = cstate(right[v]);
-		if (cstate(left[v]) == 0 || b == 0) return (0);
-		else return (1);
-	}
-}
-
-
-member(symb, set, torf) {
-	register i, num, pos;
-	num = chars[set];
-	pos = set + 1;
-	for (i=0; i<num; i++)
-		if (symb == chars[pos++]) return (torf);
-	return (!torf);
-}
-
-notin(n) {
-	register i, j, pos;
-	for (i=0; i<=n; i++) {
-		if (positions[state[i]] == count) {
-			pos = state[i] + 1;
-			for (j=0; j < count; j++)
-				if (tmpstat[positions[pos++]] != 1) goto nxt;
-			xstate = i;
-			return (0);
-		}
-		nxt: ;
-	}
-	return (1);
-}
-
-add(array, n) int *array; {
-	register i;
-	if (nxtpos + count > MAXPOS) overflo();
-	array[n] = nxtpos;
-	positions[nxtpos++] = count;
-	for (i=3; i <= line; i++) {
-		if (tmpstat[i] == 1) {
-			positions[nxtpos++] = i;
-		}
-	}
-}
-
-follow(v) int v; {
-	int p;
-	if (v == line) return;
-	p = parent[v];
-	switch(name[p]) {
-		case STAR:
-		case PLUS:	cstate(v);
-				follow(p);
-				return;
-
-		case OR:
-		case QUEST:	follow(p);
-				return;
-
-		case CAT:	if (v == left[p]) {
-					if (cstate(right[p]) == 0) {
-						follow(p);
-						return;
-					}
-				}
-				else follow(p);
-				return;
-		case FINAL:	if (tmpstat[line] != 1) {
-					tmpstat[line] = 1;
-					count++;
-				}
-				return;
-	}
-}
-
-
-main(argc, argv)
-char **argv;
-{
-	while (--argc > 0 && (++argv)[0][0]=='-')
-		switch (argv[0][1]) {
-
-		case 's':
-			sflag++;
-			continue;
-
-		case 'h':
-			hflag = 0;
-			continue;
-
-		case 'b':
-			bflag++;
-			continue;
-
-		case 'c':
-			cflag++;
-			continue;
-
-		case 'e':
-			argc--;
-			argv++;
-			goto out;
-
-		case 'f':
-			fflag++;
-			continue;
-
-		case 'q':
-			qflag++;
-			/* fall through to.. */
-
-		case 'l':
-			lflag++;
-			continue;
-
-		case 'n':
-			nflag++;
-			continue;
-
-		case 'v':
-			vflag++;
-			continue;
-
-		default:
-			fprintf(stderr, "egrep: unknown flag\n");
-			continue;
-		}
-out:
-	if (argc<=0)
-		exit(2);
-	if (fflag) {
-		fname = *argv;
-		exprfile = fopen(fname, "r");
-		if (exprfile == (FILE *)NULL) {
-			fprintf(stderr, "egrep: can't open %s\n", fname);
-			exit(2);
-		}
-	}
-	else input = *argv;
-	argc--;
-	argv++;
-
-	yyparse();
-
-	cfoll(line-1);
-	cgotofn();
-	nfile = argc;
-	if (argc<=0) {
-		if (lflag) exit(1);
-		execute(0);
-	}
-	else while (--argc >= 0) {
-		execute(*argv);
-		argv++;
-	}
-	exit(retcode != 0 ? retcode : nsucc == 0);
-}
-
-execute(file)
-char *file;
-{
-	register char *p;
-	register cstat;
-	register ccount;
-	static char *buf;
-	static int blksize;
-	struct stat stb;
-	char *nlp;
-	int istat;
-	if (file) {
-		if ((f = open(file, 0)) < 0) {
-			fprintf(stderr, "egrep: can't open %s\n", file);
-			retcode = 2;
-			return;
-		}
-	}
-	else f = 0;
-	if (buf == NULL) {
-		if (fstat(f, &stb) > 0 && stb.st_blksize > 0)
-			blksize = stb.st_blksize;
-		else
-			blksize = BLKSIZE;
-		buf = (char *)malloc(2*blksize);
-		if (buf == NULL) {
-			fprintf(stderr, "egrep: no memory for %s\n", file);
-			retcode = 2;
-			return;
-		}
-	}
-	ccount = 0;
-	lnum = 1;
-	tln = 0;
-	blkno = 0;
-	p = buf;
-	nlp = p;
-	if ((ccount = read(f,p,blksize))<=0) goto done;
-	istat = cstat = gotofn[0]['\n'];
-	if (out[cstat]) goto found;
-	for (;;) {
-		cstat = gotofn[cstat][*p&0377];	/* all input chars made positive */
-		if (out[cstat]) {
-		found:	for(;;) {
-				if (*p++ == '\n') {
-					if (vflag == 0) {
-				succeed:	nsucc = 1;
-						if (cflag) tln++;
-						else if (sflag)
-							;	/* ugh */
-						else if (lflag) {
-							if (!qflag)
-								printf("%s\n", file);
-							close(f);
-							return;
-						}
-						else {
-							if (nfile > 1 && hflag) printf("%s:", file);
-							if (bflag) printf("%d:", blkno);
-							if (nflag) printf("%ld:", lnum);
-							if (p <= nlp) {
-								while (nlp < &buf[2*blksize]) putchar(*nlp++);
-								nlp = buf;
-							}
-							while (nlp < p) putchar(*nlp++);
-						}
-					}
-					lnum++;
-					nlp = p;
-					if ((out[(cstat=istat)]) == 0) goto brk2;
-				}
-				cfound:
-				if (--ccount <= 0) {
-					if (p <= &buf[blksize]) {
-						if ((ccount = read(f, p, blksize)) <= 0) goto done;
-					}
-					else if (p == &buf[2*blksize]) {
-						p = buf;
-						if ((ccount = read(f, p, blksize)) <= 0) goto done;
-					}
-					else {
-						if ((ccount = read(f, p, &buf[2*blksize]-p)) <= 0) goto done;
-					}
-					blkno += ccount / 512;
-				}
-			}
-		}
-		if (*p++ == '\n') {
-			if (vflag) goto succeed;
-			else {
-				lnum++;
-				nlp = p;
-				if (out[(cstat=istat)]) goto cfound;
-			}
-		}
-		brk2:
-		if (--ccount <= 0) {
-			if (p <= &buf[blksize]) {
-				if ((ccount = read(f, p, blksize)) <= 0) break;
-			}
-			else if (p == &buf[2*blksize]) {
-				p = buf;
-				if ((ccount = read(f, p, blksize)) <= 0) break;
-			}
-			else {
-				if ((ccount = read(f, p, &buf[2*blksize] - p)) <= 0) break;
-			}
-			blkno += ccount / 512;
-		}
-	}
-done:	close(f);
-	if (cflag) {
-		if (nfile > 1)
-			printf("%s:", file);
-		printf("%ld\n", tln);
-	}
-}
diff -Naur 4bsd-1.0/egrep/Makefile 4bsd-test/egrep/Makefile
--- 4bsd-1.0/egrep/Makefile	2002-07-10 09:17:21.000000000 +0200
+++ 4bsd-test/egrep/Makefile	1970-01-01 01:00:00.000000000 +0100
@@ -1,53 +0,0 @@
-#
-#	Makefile for egrep
-#
-DESTDIR=
-CFLAGS=	-O -DUW
-
-PROGRAM=	egrep
-SRCS=		egrep.c
-LIBS=
-
-${PROGRAM} :
-	${YACC} ${YFLAGS} $@.y
-	${CC} -c ${CFLAGS} y.tab.c
-	mv y.tab.o $@.o
-	${CC} -o $@ $@.o
-	rm -f $@.o
-
-install:
-	install -s ${PROGRAM} ${DESTDIR}/bin/${PROGRAM}
-
-tags:
-	ctags -tdw *.c 
-
-clean:
-	rm -f ${PROGRAM} a.out core *.s *.o made
-
-
-depend: 
-	for i in ${SRCS}; do \
-	    cc -M ${INCPATH} $$i | sed 's/\.o//' | \
-	    awk ' { if ($$1 != prev) \
-		{ if (rec != "") print rec; rec = $$0; prev = $$1; } \
-		else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
-		else rec = rec " " $$2 } } \
-		END { print rec } ' >> makedep; done
-	echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
-	echo '$$r makedep' >>eddep
-	echo 'w' >>eddep
-	cp Makefile Makefile.bak
-	ed - Makefile < eddep
-	rm eddep makedep
-	echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
-	echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
-	echo '# see make depend above' >> Makefile
-
-# DO NOT DELETE THIS LINE -- make depend uses it
-# DEPENDENCIES MUST END AT END OF FILE
-
-
-
-# DEPENDENCIES MUST END AT END OF FILE
-# IF YOU PUT STUFF HERE IT WILL GO AWAY
-# see make depend above
diff -Naur 4bsd-1.0/egrep/Makefile.bak 4bsd-test/egrep/Makefile.bak
--- 4bsd-1.0/egrep/Makefile.bak	2002-07-10 09:17:21.000000000 +0200
+++ 4bsd-test/egrep/Makefile.bak	1970-01-01 01:00:00.000000000 +0100
@@ -1,50 +0,0 @@
-#
-#	Makefile for egrep
-#
-DESTDIR=
-CFLAGS=	-O -DUW
-
-PROGRAM=	egrep
-SRCS=		egrep.c
-LIBS=
-
-${PROGRAM} :
-	${YACC} ${YFLAGS} $@.y
-	${CC} -c ${CFLAGS} y.tab.c
-	mv y.tab.o $@.o
-	${CC} -o $@ $@.o
-	rm -f $@.o
-
-install:
-	install -s ${PROGRAM} ${DESTDIR}/bin/${PROGRAM}
-
-tags:
-	ctags -tdw *.c 
-
-clean:
-	rm -f ${PROGRAM} a.out core *.s *.o made
-
-
-depend: 
-	for i in ${SRCS}; do \
-	    cc -M ${INCPATH} $$i | sed 's/\.o//' | \
-	    awk ' { if ($$1 != prev) \
-		{ if (rec != "") print rec; rec = $$0; prev = $$1; } \
-		else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
-		else rec = rec " " $$2 } } \
-		END { print rec } ' >> makedep; done
-	echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
-	echo '$$r makedep' >>eddep
-	echo 'w' >>eddep
-	cp Makefile Makefile.bak
-	ed - Makefile < eddep
-	rm eddep makedep
-	echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
-	echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
-	echo '# see make depend above' >> Makefile
-
-# DO NOT DELETE THIS LINE -- make depend uses it
-# DEPENDENCIES MUST END AT END OF FILE
-# DEPENDENCIES MUST END AT END OF FILE
-# IF YOU PUT STUFF HERE IT WILL GO AWAY
-# see make depend above
diff -Naur 4bsd-1.0/fgrep/Makefile 4bsd-test/fgrep/Makefile
--- 4bsd-1.0/fgrep/Makefile	2002-07-10 09:17:21.000000000 +0200
+++ 4bsd-test/fgrep/Makefile	2003-05-29 11:20:12.000000000 +0200
@@ -18,7 +18,7 @@
 	ctags -tdw *.c 
 
 clean:
-	rm -f ${PROGRAM} a.out core *.s *.o made
+	rm -f Makefile.bak ${PROGRAM} a.out core *.s *.o made
 
 
 depend: 
@@ -41,23 +41,29 @@
 
 # DO NOT DELETE THIS LINE -- make depend uses it
 # DEPENDENCIES MUST END AT END OF FILE
-fgrep: fgrep.c /usr/ia32-linuxaout/include/stdio.h \
- /usr/ia32-linuxaout/include/features.h \
- /usr/ia32-linuxaout/include/sys/cdefs.h \
- /usr/ia32-linuxaout/include/libio.h \
- /usr/ia32-linuxaout/include/_G_config.h \
- /usr/ia32-linuxaout/include/ctype.h \
- /usr/ia32-linuxaout/include/sys/param.h \
- /usr/ia32-linuxaout/include/limits.h \
- /usr/ia32-linuxaout/include/posix1_lim.h /usr/include/linux/limits.h \
- /usr/ia32-linuxaout/include/posix2_lim.h \
- /usr/lib/gcc-lib/ia32-linuxaout/2.7.2.3/include/limits.h \
- /usr/include/linux/param.h /usr/include/asm/param.h \
- /usr/ia32-linuxaout/include/sys/types.h \
- /usr/ia32-linuxaout/include/sys/bitypes.h /usr/include/linux/types.h \
- /usr/include/linux/posix_types.h /usr/include/asm/posix_types.h \
- /usr/include/asm/types.h /usr/ia32-linuxaout/include/sys/stat.h \
- /usr/include/linux/stat.h
+fgrep: fgrep.c /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/include/stdio.h \
+  /usr/include/features.h /usr/include/sys/cdefs.h \
+  /usr/include/gnu/stubs.h \
+  /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/include/stddef.h \
+  /usr/include/bits/types.h /usr/include/bits/wordsize.h \
+  /usr/include/bits/typesizes.h /usr/include/libio.h \
+  /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \
+  /usr/include/gconv.h \
+  /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
+  /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h \
+  /usr/include/sys/param.h \
+  /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/include/limits.h \
+  /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/include/syslimits.h \
+  /usr/include/limits.h /usr/include/bits/posix1_lim.h \
+  /usr/include/bits/local_lim.h /usr/include/linux/limits.h \
+  /usr/include/bits/posix2_lim.h /usr/include/linux/param.h \
+  /usr/include/asm/param.h /usr/include/sys/types.h /usr/include/time.h \
+  /usr/include/sys/select.h /usr/include/bits/select.h \
+  /usr/include/bits/sigset.h /usr/include/bits/time.h \
+  /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \
+  /usr/include/bits/sched.h /usr/include/sys/stat.h \
+  /usr/include/bits/stat.h
 # DEPENDENCIES MUST END AT END OF FILE
 # IF YOU PUT STUFF HERE IT WILL GO AWAY
 # see make depend above
diff -Naur 4bsd-1.0/fgrep/Makefile.bak 4bsd-test/fgrep/Makefile.bak
--- 4bsd-1.0/fgrep/Makefile.bak	2002-07-10 09:17:21.000000000 +0200
+++ 4bsd-test/fgrep/Makefile.bak	1970-01-01 01:00:00.000000000 +0100
@@ -1,49 +0,0 @@
-#
-#	Makefile for fgrep
-#
-DESTDIR=
-CFLAGS=	-O -DUW
-
-PROGRAM=	fgrep
-SRCS=		fgrep.c
-LIBS=
-
-${PROGRAM}:	${SRCS}
-	${CC} ${CFLAGS} -o $@ $@.c ${LIBS}
-
-install:
-	install -s ${PROGRAM} ${DESTDIR}/bin/${PROGRAM}
-
-tags:
-	ctags -tdw *.c 
-
-clean:
-	rm -f ${PROGRAM} a.out core *.s *.o made
-
-
-depend: 
-	for i in ${SRCS}; do \
-	    cc -M ${INCPATH} $$i | sed 's/\.o//' | \
-	    awk ' { if ($$1 != prev) \
-		{ if (rec != "") print rec; rec = $$0; prev = $$1; } \
-		else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
-		else rec = rec " " $$2 } } \
-		END { print rec } ' >> makedep; done
-	echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
-	echo '$$r makedep' >>eddep
-	echo 'w' >>eddep
-	cp Makefile Makefile.bak
-	ed - Makefile < eddep
-	rm eddep makedep
-	echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
-	echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
-	echo '# see make depend above' >> Makefile
-
-# DO NOT DELETE THIS LINE -- make depend uses it
-# DEPENDENCIES MUST END AT END OF FILE
-fgrep: fgrep.c /usr/include/stdio.h /usr/include/ctype.h
-fgrep: /usr/include/sys/param.h /usr/include/machine/machparam.h
-fgrep: /usr/include/signal.h /usr/include/sys/types.h /usr/include/sys/stat.h
-# DEPENDENCIES MUST END AT END OF FILE
-# IF YOU PUT STUFF HERE IT WILL GO AWAY
-# see make depend above
diff -Naur 4bsd-1.0/grep/Makefile 4bsd-test/grep/Makefile
--- 4bsd-1.0/grep/Makefile	2002-07-10 09:17:21.000000000 +0200
+++ 4bsd-test/grep/Makefile	2003-05-29 11:20:30.000000000 +0200
@@ -18,7 +18,7 @@
 	ctags -tdw *.c 
 
 clean:
-	rm -f ${PROGRAM} a.out core *.s *.o made
+	rm -f Makefile.bak ${PROGRAM} a.out core *.s *.o made
 
 
 depend: 
@@ -41,12 +41,17 @@
 
 # DO NOT DELETE THIS LINE -- make depend uses it
 # DEPENDENCIES MUST END AT END OF FILE
-grep: grep.c /usr/ia32-linuxaout/include/stdio.h \
- /usr/ia32-linuxaout/include/features.h \
- /usr/ia32-linuxaout/include/sys/cdefs.h \
- /usr/ia32-linuxaout/include/libio.h \
- /usr/ia32-linuxaout/include/_G_config.h \
- /usr/ia32-linuxaout/include/ctype.h
+grep: grep.c /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/include/stdio.h \
+  /usr/include/features.h /usr/include/sys/cdefs.h \
+  /usr/include/gnu/stubs.h \
+  /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/include/stddef.h \
+  /usr/include/bits/types.h /usr/include/bits/wordsize.h \
+  /usr/include/bits/typesizes.h /usr/include/libio.h \
+  /usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \
+  /usr/include/gconv.h \
+  /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/include/stdarg.h \
+  /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
+  /usr/include/ctype.h /usr/include/endian.h /usr/include/bits/endian.h
 # DEPENDENCIES MUST END AT END OF FILE
 # IF YOU PUT STUFF HERE IT WILL GO AWAY
 # see make depend above
diff -Naur 4bsd-1.0/grep/Makefile.bak 4bsd-test/grep/Makefile.bak
--- 4bsd-1.0/grep/Makefile.bak	2002-07-10 09:17:21.000000000 +0200
+++ 4bsd-test/grep/Makefile.bak	1970-01-01 01:00:00.000000000 +0100
@@ -1,52 +0,0 @@
-#
-#	Makefile for grep
-#
-DESTDIR=
-CFLAGS=	-O -DUW
-
-PROGRAM=	grep
-SRCS=		grep.c
-LIBS=
-
-${PROGRAM}:	${SRCS}
-	${CC} ${CFLAGS} -o $@ $@.c ${LIBS}
-
-install:
-	install -s ${PROGRAM} ${DESTDIR}/bin/${PROGRAM}
-
-tags:
-	ctags -tdw *.c 
-
-clean:
-	rm -f ${PROGRAM} a.out core *.s *.o made
-
-
-depend: 
-	for i in ${SRCS}; do \
-	    cc -M ${INCPATH} $$i | sed 's/\.o//' | \
-	    awk ' { if ($$1 != prev) \
-		{ if (rec != "") print rec; rec = $$0; prev = $$1; } \
-		else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
-		else rec = rec " " $$2 } } \
-		END { print rec } ' >> makedep; done
-	echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
-	echo '$$r makedep' >>eddep
-	echo 'w' >>eddep
-	cp Makefile Makefile.bak
-	ed - Makefile < eddep
-	rm eddep makedep
-	echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
-	echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
-	echo '# see make depend above' >> Makefile
-
-# DO NOT DELETE THIS LINE -- make depend uses it
-# DEPENDENCIES MUST END AT END OF FILE
-grep: grep.c /usr/ia32-linuxaout/include/stdio.h \
- /usr/ia32-linuxaout/include/features.h \
- /usr/ia32-linuxaout/include/sys/cdefs.h \
- /usr/ia32-linuxaout/include/libio.h \
- /usr/ia32-linuxaout/include/_G_config.h \
- /usr/ia32-linuxaout/include/ctype.h
-# DEPENDENCIES MUST END AT END OF FILE
-# IF YOU PUT STUFF HERE IT WILL GO AWAY
-# see make depend above
diff -Naur 4bsd-1.0/Mastodon.build 4bsd-test/Mastodon.build
--- 4bsd-1.0/Mastodon.build	2002-07-10 09:17:21.000000000 +0200
+++ 4bsd-test/Mastodon.build	1970-01-01 01:00:00.000000000 +0100
@@ -1,44 +0,0 @@
-#! /bin/sh
-#
-# Mastodon buildfile for my ported BSD4.2 tools
-#
-
-. ./Mastodon.inc
-
-exedir BIN
-
-install_manpages() {
-    for t in 1 2 3 4 5 6 7 8 9; do
-	for m in $1/*.$t; do
-	    if [ -f $m ]; then
-		install -d -m 755 -o man -g man $BIN/usr/man/man$t
-		install -c -m 444 -o man -g man $m $BIN/usr/man/man$t
-	    fi
-	done
-    done
-}
-
-install -d -m 755 -o root -g root $BIN/bin
-install -d -m 755 -o root -g root $BIN/usr/bin
-install -d -m 755 -o root -g root $BIN/usr/lib
-# install -d -m 755 -o root -g root $BIN/usr/share/groff/tmac
-
-. ../core.env
-
-if [ $# -gt 0 ]; then
-    APPS=$*
-elif [ "$KSH_IS_SH" ]; then
-    APPS=`ls -1d [a-z]* | grep -v sh`
-else
-    APPS=`echo [a-z]*`
-fi
-for x in $APPS;do
-    if [ -d $x ]; then
-	make -C $x clean
-	CC="$SYSCC" CFLAGS=-O2 make -C $x || exit 1
-	make DESTDIR=$BIN -C $x install
-	install_manpages $x
-    fi
-done
-
-exit 0
diff -Naur 4bsd-1.0/VERSION 4bsd-test/VERSION
--- 4bsd-1.0/VERSION	2002-07-10 09:17:21.000000000 +0200
+++ 4bsd-test/VERSION	1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-1.0
diff -Naur 4bsd-1.0/vi/ex_addr.c 4bsd-test/vi/ex_addr.c
--- 4bsd-1.0/vi/ex_addr.c	2002-07-10 09:17:21.000000000 +0200
+++ 4bsd-test/vi/ex_addr.c	2003-05-29 11:37:15.000000000 +0200
@@ -6,7 +6,7 @@
 
 #if	!defined(lint) && defined(DOSCCS)
 static char *sccsid = "@(#)ex_addr.c	7.3 (Berkeley) 6/7/85";
-#endif not lint
+#endif /* not lint */
 
 #include "ex.h"
 #include "ex_re.h"
diff -Naur 4bsd-1.0/vi/ex.c 4bsd-test/vi/ex.c
--- 4bsd-1.0/vi/ex.c	2002-07-10 09:17:21.000000000 +0200
+++ 4bsd-test/vi/ex.c	2003-05-29 11:40:11.000000000 +0200
@@ -10,8 +10,9 @@
  All rights reserved.\n";
 
 static char *sccsid = "@(#)ex.c	7.5.1.1 (Berkeley) 8/12/86";
-#endif not lint
+#endif /* not lint */
 
+#define _GNU_SOURCE
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
@@ -162,15 +163,15 @@
 	 * Initialize interrupt handling.
 	 */
 	oldhup = signal(SIGHUP, SIG_IGN);
-	if (oldhup == SIG_DFL)
-		signal(SIGHUP, onhup);
+	if (oldhup == (int) SIG_DFL)
+		signal(SIGHUP, (sighandler_t) onhup);
 	oldquit = signal(SIGQUIT, SIG_IGN);
 	ruptible = signal(SIGINT, SIG_IGN) == SIG_DFL;
 	if (signal(SIGTERM, SIG_IGN) == SIG_DFL)
-		signal(SIGTERM, onhup);
+		signal(SIGTERM, (sighandler_t) onhup);
 #ifdef	SIGEMT
 	if (signal(SIGEMT, SIG_IGN) == SIG_DFL)
-		signal(SIGEMT, onemt);
+		signal(SIGEMT, (sighandler_t) onemt);
 #endif
 
 	/*
@@ -268,7 +269,7 @@
 
 #ifdef SIGTSTP
 	if (!hush && signal(SIGTSTP, SIG_IGN) == SIG_DFL)
-		signal(SIGTSTP, onsusp), dosusp++;
+		signal(SIGTSTP, (sighandler_t) onsusp), dosusp++;
 #endif
 
 	if (ac && av[0][0] == '+') {
diff -Naur 4bsd-1.0/vi/ex_cmdsub.c 4bsd-test/vi/ex_cmdsub.c
--- 4bsd-1.0/vi/ex_cmdsub.c	2002-07-10 09:17:21.000000000 +0200
+++ 4bsd-test/vi/ex_cmdsub.c	2003-05-29 11:38:47.000000000 +0200
@@ -8,6 +8,7 @@
 static char *sccsid = "@(#)ex_cmdsub.c	7.7 (Berkeley) 6/7/85";
 #endif
 
+#define _GNU_SOURCE
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
@@ -120,7 +121,8 @@
 			vudump("before delete");
 #endif
 		change();
-		dsavint = signal(SIGINT, SIG_IGN);
+		//TODO
+		//dsavint = signal(SIGINT, SIG_IGN);
 		undkind = UNDCHANGE;
 		a1 = addr1;
 		squish();
@@ -136,7 +138,7 @@
 			a1 = dol;
 		dot = a1;
 		pkill[0] = pkill[1] = 0;
-		signal(SIGINT, dsavint);
+		signal(SIGINT, (sighandler_t) dsavint);
 #ifdef TRACE
 		if (trace)
 			vudump("after delete");
diff -Naur 4bsd-1.0/vi/ex.h 4bsd-test/vi/ex.h
--- 4bsd-1.0/vi/ex.h	2002-07-10 09:17:21.000000000 +0200
+++ 4bsd-test/vi/ex.h	2003-05-29 11:37:40.000000000 +0200
@@ -374,7 +374,7 @@
 extern	int	(*Outchar)();
 extern	int	(*Pline)();
 extern	int	(*Putchar)();
-var	int	(*oldhup)();
+var	int (*oldhup)();
 int	(*setlist())();
 int	(*setnorm())();
 int	(*setnorm())();
@@ -420,9 +420,9 @@
 int	normline();
 int	numbline();
 var	int	(*oldquit)();
-int	onhup();
-int	onintr();
-int	onsusp();
+int onhup();
+int onintr();
+int onsusp();
 int	putch();
 int	shift();
 int	termchar();
diff -Naur 4bsd-1.0/vi/ex_subr.c 4bsd-test/vi/ex_subr.c
--- 4bsd-1.0/vi/ex_subr.c	2002-07-10 09:17:21.000000000 +0200
+++ 4bsd-test/vi/ex_subr.c	2003-05-29 11:39:31.000000000 +0200
@@ -8,6 +8,7 @@
 static char *sccsid = "@(#)ex_subr.c	7.10.1 (2.11BSD) 1996/3/22";
 #endif
 
+#define _GNU_SOURCE
 #include "ex.h"
 #include "ex_re.h"
 #include "ex_tty.h"
@@ -825,9 +826,9 @@
 {
 
 #ifndef CBREAK
-	signal(SIGINT, onintr);
+	signal(SIGINT, (sighandler_t) onintr);
 #else
-	signal(SIGINT, inopen ? vintr : onintr);
+	signal(SIGINT, (sighandler_t) inopen ? vintr : onintr);
 #endif
 	alarm(0);	/* in case we were called from map */
 	draino();
diff -Naur 4bsd-1.0/vi/Makefile 4bsd-test/vi/Makefile
--- 4bsd-1.0/vi/Makefile	2002-07-10 09:17:21.000000000 +0200
+++ 4bsd-test/vi/Makefile	2003-05-29 11:41:34.000000000 +0200
@@ -38,7 +38,8 @@
 # define to use ISO-8859-X character sets (doesn't work well)
 # OPTIONS += -DISO
 LDFLAGS=
-TERMLIB=-ltermcap
+TERMLIB=-lncurses
+#TERMLIB=-Ltermcap -ltermlib
 
 # That's it.
 
@@ -60,8 +61,7 @@
 
 all: ex expreserve exrecover
 
-ex: $(OBJS)
-	#cd termcap && make
+ex: $(OBJS) termcap
 	$(CC) -o ex $(LDFLAGS) $(OBJS) $(TERMLIB)
 
 $(OBJS): $(HDRS)
@@ -71,8 +71,8 @@
 
 clean:
 	cd termcap && make clean
-#	If we dont have ex we cant make it so don't rm ex_vars.h
-	-rm -f ex *.o x*.[cs] core errs trace
+	-rm -f ex expreserve exrecover *.o x*.[cs] core errs trace
+	make -C termcap clean
 
 exrecover: exrecover.o ex_extern.o
 	${CC} ${SEPFLAG} ${CFLAGS} exrecover.o ex_extern.o -o exrecover
@@ -86,6 +86,10 @@
 expreserve.o:
 	${CC} ${CFLAGS} -c -O expreserve.c
 
+termcap: termcap/libtermcap.a
+
+termcap/libtermcap.a:
+	make -C termcap
 
 # install in standard place
 install: ex
diff -Naur 4bsd-1.0/vi/Makefile.old 4bsd-test/vi/Makefile.old
--- 4bsd-1.0/vi/Makefile.old	2002-07-10 09:17:21.000000000 +0200
+++ 4bsd-test/vi/Makefile.old	1970-01-01 01:00:00.000000000 +0100
@@ -1,175 +0,0 @@
-#
-# Copyright (c) 1980 Regents of the University of California.
-# All rights reserved.  The Berkeley software License Agreement
-# specifies the terms and conditions for redistribution.
-#
-#	@(#)Makefile	7.13.1.3 (2.11BSD GTE) 1996/10/23
-#
-VERSION=3.7
-#
-# NB: This makefile doesn't indicate any dependencies on header files.
-#
-# Ex is very large - this version will not fit on PDP-11's without overlay
-# software.  Things that can be turned off to save
-# space include LISPCODE (-l flag, showmatch and lisp options), CHDIR (the 
-# undocumented chdir command.)  VMUNIX makes ex considerably larger, raising 
-# many limits and improving speed and simplicity of maintenance.  It is 
-# suitable only for a VAX or other large machine, and then probably only in 
-# a paged system.
-#
-# Don't define VFORK unless your system has the VFORK system call,
-# which is like fork but the two processes have only one data space until the
-# child execs. This speeds up ex by saving the memory copy.
-#
-# If your system expands tabs to 4 spaces you should -DTABS=4 below
-#
-BINDIR=	/usr/ucb
-SBINDIR= /usr/sbin
-MISCDIR= /usr/share/misc
-FOLD=	${BINDIR}/fold
-CTAGS=	${BINDIR}/ctags
-XSTR=	${BINDIR}/xstr
-DEBUGFLAGS=	-DTRACE -g
-NONDEBUGFLAGS=	-O
-DEB=	${NONDEBUGFLAGS}	# or ${DEBUGFLAGS} to to debug
-#OPTIONS= -DLISPCODE -DCHDIR -DVFORK -DVMUNIX -DFASTTAG
-OPTIONS= -DLISPCODE -DCHDIR -DVFORK -DFASTTAG
-CFLAGS=	-DTABS=8 ${OPTIONS} ${DEB}
-LDFLAGS= -X
-SEPFLAG= -i
-TERMLIB=	-ltermcap
-MKSTR=	${BINDIR}/mkstr
-CXREF=	${BINDIR}/cxref
-INCLUDE=/usr/include
-PR=	pr
-OBJS=	ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \
-	ex_data.o ex_extern.o ex_get.o ex_io.o ex_put.o ex_re.o \
-	ex_set.o ex_subr.o ex_tagio.o ex_temp.o ex_tty.o ex_unix.o \
-	ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voper.o \
-	ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
-	printf.o strings.o
-HDRS=	ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
-SRC1=	ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c
-SRC2=	ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c
-SRC3=	ex_set.c ex_subr.c ex_tagio.c ex_temp.c ex_tty.c ex_unix.c
-SRC4=	ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voper.c
-SRC5=	ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c
-SRC6=	printf.c expreserve.c exrecover.c
-MISC=	makefile READ_ME
-VGRIND=	csh /usr/ucb/vgrind
-VHDR=	"Ex Version ${VERSION}"
-
-.c.o:
-# ifdef VMUNIX
-#	${CC} -E ${CFLAGS} $*.c | ${XSTR} -c -
-# else
-	${MKSTR} - exstrings x $*.c
-	${CC} -E ${CFLAGS} x$*.c | ${XSTR} -c -
-	rm -f x$*.c
-# endif
-	${CC} ${CFLAGS} -c x.c 
-	mv x.o $*.o
-
-all:	a.out exrecover expreserve
-
-# 11/23, 34, 40 and other non split I/D machines
-# each of the 6 overlays must stay less than 16K.
-
-a.out: ${OBJS}
-	-if [ X${SEPFLAG} = X-i ]; then \
-		ld ${LDFLAGS} /lib/crt0.o ${SEPFLAG} \
-		    -Z ex_voper.o ex_vget.o ex_vops.o ex_vops2.o ex_vops3.o \
-		    -Z ex_set.o ex_re.o ex_io.o ex_tty.o ex_unix.o ex.o ex_v.o \
-		    -Y ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o ex_tagio.o \
-		       ex_get.o ex_temp.o ex_vadj.o ex_vmain.o ex_vwind.o\
-		       ex_vput.o ex_put.o ex_subr.o printf.o strings.o \
-		       ex_data.o ex_extern.o ${TERMLIB} -lc; \
-	else \
-		ld ${LDFLAGS} /lib/crt0.o ${SEPFLAG} \
-		    -Z ex_cmds.o ex_cmds2.o ex_cmdsub.o ex_tagio.o ex_re.o \
-		    -Z ex_vadj.o ex_vmain.o ex_voper.o ex_vwind.o ex_vops3.o\
-		    -Z ex_v.o ex_vget.o ex_vops.o ex_vops2.o ex_vput.o\
-		    -Z ex_get.o ex_io.o ex_temp.o ex_tty.o ex_unix.o \
-			ex_addr.o ex.o ex_set.o \
-		    -Z ex_put.o ex_subr.o ${TERMLIB} \
-		    -Y ex_data.o ex_extern.o printf.o strings.o -lc; \
-	fi
-
-tags:	/tmp
-	${CTAGS} -w ex.[hc] ex_*.[hc]
-
-${OBJS}: ${HDRS}
-
-ex_vars.h:
-	csh makeoptions ${CFLAGS}
-
-# xstr: hands off!
-strings.o: strings
-	${XSTR}
-	${CC} -c -o strings.o xs.c
-	
-exrecover: exrecover.o ex_extern.o
-	${CC} ${SEPFLAG} ${CFLAGS} exrecover.o ex_extern.o -o exrecover
-
-exrecover.o: exrecover.c
-	${CC} ${CFLAGS} -c -O exrecover.c
-
-expreserve: expreserve.o
-	${CC} ${SEPFLAG} expreserve.o -o expreserve
-
-expreserve.o:
-	${CC} ${CFLAGS} -c -O expreserve.c
-
-clean:
-#	If we dont have ex we cant make it so don't rm ex_vars.h
-	-rm -f a.out exrecover expreserve exstrings strings
-	-rm -f *.o x*.[cs] core errs trace
-
-# install in standard place (/usr/ucb)
-install: a.out exrecover expreserve
-	-rm -f ${DESTDIR}/${BINDIR}/ex
-	-rm -f ${DESTDIR}/${BINDIR}/vi
-	-rm -f ${DESTDIR}/${BINDIR}/view
-	-rm -f ${DESTDIR}/usr/bin/ex
-	install -s -m 1755 a.out ${DESTDIR}/${BINDIR}/ex
-	install -c -m 444  exstrings ${DESTDIR}/${MISCDIR}/exstrings
-	ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/vi
-	ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/${BINDIR}/view
-	ln ${DESTDIR}/${BINDIR}/ex ${DESTDIR}/usr/bin/ex
-	chmod 1755 ${DESTDIR}/${BINDIR}/ex
-	install -s -o root -m 4755 exrecover ${DESTDIR}/${SBINDIR}/exrecover
-	install -s -o root -m 4755 expreserve ${DESTDIR}/${SBINDIR}/expreserve
-# The following line normally fails.  This is OK.
-	-mkdir ${DESTDIR}/usr/preserve
-
-lint:
-	lint ${CFLAGS} ex.c ex_?*.c
-	lint ${CFLAGS} -u exrecover.c
-	lint ${CFLAGS} expreserve.c
-
-print:
-	@${PR} READ* BUGS
-	@${PR} makefile*
-	@${PR} /etc/termcap
-	@(size -l a.out ; size *.o) | ${PR} -h sizes
-	@${PR} -h errno.h ${INCLUDE}/errno.h
-	@${PR} -h setjmp.h ${INCLUDE}/setjmp.h
-	@${PR} -h sgtty.h ${INCLUDE}/sgtty.h
-	@${PR} -h signal.h ${INCLUDE}/signal.h
-	@${PR} -h sys/stat.h ${INCLUDE}/sys/stat.h
-	@${PR} -h sys/types.h ${INCLUDE}/sys/types.h
-	@ls -ls | ${PR}
-	@${CXREF} *.c | ${PR} -h XREF
-	@${PR} *.h *.c
-
-vgrind:
-	tee index < /dev/null
-	${VGRIND} -h ${VHDR} ${HDRS}
-	${VGRIND} -h ${VHDR} ${SRC1}
-	${VGRIND} -h ${VHDR} ${SRC2}
-	${VGRIND} -h ${VHDR} ${SRC3}
-	${VGRIND} -h ${VHDR} ${SRC4}
-	${VGRIND} -h ${VHDR} ${SRC5}
-	${VGRIND} -h ${VHDR} ${SRC6}
-	${VGRIND} -n -h ${VHDR} ${MISC}
-	${VGRIND} -i -h ${VHDR} index
diff -Naur 4bsd-1.0/vi/termcap/termcap.c 4bsd-test/vi/termcap/termcap.c
--- 4bsd-1.0/vi/termcap/termcap.c	2002-07-10 09:17:21.000000000 +0200
+++ 4bsd-test/vi/termcap/termcap.c	2003-05-29 11:22:06.000000000 +0200
@@ -6,7 +6,7 @@
 
 #if	!defined(lint) && !defined(NOSCCS)
 static char sccsid[] = "@(#)termcap.c	5.1 (Berkeley) 6/5/85";
-#endif not lint
+#endif /* not lint */
 
 #if 0	/* GR */
 #define	TCBUFSIZE		1024
diff -Naur 4bsd-1.0/vi/termcap/tgoto.c 4bsd-test/vi/termcap/tgoto.c
--- 4bsd-1.0/vi/termcap/tgoto.c	2002-07-10 09:17:21.000000000 +0200
+++ 4bsd-test/vi/termcap/tgoto.c	2003-05-29 11:22:17.000000000 +0200
@@ -6,7 +6,7 @@
 
 #if	!defined(lint) && !defined(NOSCCS)
 static char sccsid[] = "@(#)tgoto.c	5.1 (Berkeley) 6/5/85";
-#endif not lint
+#endif /* not lint */
 
 #define	CTRL(c)	('c' & 037)
 
diff -Naur 4bsd-1.0/vi/termcap/tputs.c 4bsd-test/vi/termcap/tputs.c
--- 4bsd-1.0/vi/termcap/tputs.c	2002-07-10 09:17:21.000000000 +0200
+++ 4bsd-test/vi/termcap/tputs.c	2003-05-29 11:22:33.000000000 +0200
@@ -6,7 +6,7 @@
 
 #if	!defined(lint) && !defined(NOSCCS)
 static char sccsid[] = "@(#)tputs.c	5.1 (Berkeley) 6/5/85";
-#endif not lint
+#endif /* not lint */
 
 #include <sgtty.h>
 #include <ctype.h>
