*** sccs.bsd/Makefile	Mon May 10 15:50:31 1993
--- sccs/Makefile	Mon May 10 15:10:40 1993
***************
*** 1,5 ****
  #	@(#)Makefile	5.3 (Berkeley) 5/11/90
  
! PROG=	sccs
  
! .include <bsd.prog.mk>
--- 1,12 ----
  #	@(#)Makefile	5.3 (Berkeley) 5/11/90
  
! PROG	= sccs
  
! CC	= gcc
! CFLAGS	= -g -O -fpcc-struct-return -funsigned-char
! LIBS	= -lcrypt -lresolv
! 
! sccs :	sccs.o
! 	$(CC) -o $@ $< $(LIBS)
! 
! sccs.o : sccs.c pathnames.h Makefile
*** sccs.bsd/pathnames.h	Mon May 10 15:50:33 1993
--- sccs/pathnames.h	Mon May 10 15:14:11 1993
***************
*** 33,38 ****
--- 33,55 ----
   *	@(#)pathnames.h	5.6 (Berkeley) 3/4/91
   */
  
+ #if defined(__convex__)
+ 
+ #define	_PATH_SCCSADMIN	"/usr/toolbox/admin"
+ #define	_PATH_SCCSBDIFF	"/usr/toolbox/bdiff"
+ #define	_PATH_SCCSCOMB	"/usr/toolbox/comb"
+ #define	_PATH_SCCSDELTA	"/usr/toolbox/delta"
+ #define	_PATH_SCCSDIFF	"/usr/toolbox/sccsdiff"
+ #define	_PATH_SCCSGET	"/usr/toolbox/get"
+ #define	_PATH_SCCSHELP	"/usr/toolbox/help"
+ #define	_PATH_SCCSPRS	"/usr/toolbox/prs"
+ #define	_PATH_SCCSPRT	"/usr/toolbox/prt"
+ #define	_PATH_SCCSRMDEL	"/usr/toolbox/rmdel"
+ #define	_PATH_SCCSVAL	"/usr/toolbox/val"
+ #define	_PATH_SCCSWHAT	"/usr/toolbox/what"
+ 
+ #else
+ 
  #include <paths.h>
  
  #define	_PATH_SCCSADMIN	"/usr/local/bin/admin"
***************
*** 47,51 ****
--- 64,75 ----
  #define	_PATH_SCCSRMDEL	"/usr/local/bin/rmdel"
  #define	_PATH_SCCSVAL	"/usr/local/bin/val"
  #define	_PATH_SCCSWHAT	"/usr/local/bin/what"
+ 
+ #endif
+ 
  #undef _PATH_TMP
  #define	_PATH_TMP	"/tmp/sccsXXXXX"
+ 
+ #if !defined(_PATH_BSHELL)
+ #define _PATH_BSHELL	"/bin/sh"
+ #endif
*** sccs.bsd/sccs.1	Mon May 10 15:50:34 1993
--- sccs/sccs.1	Mon May 10 15:39:30 1993
***************
*** 31,96 ****
  .\"
  .\"	@(#)sccs.1	2.10 (Berkeley) 7/24/91
  .\"
! .Dd July 24, 1991
! .Dt SCCS 1
! .Os BSD 4.2
! .Sh NAME
! .Nm sccs
! .Nd front end for the
! .Li SCCS
! subsystem
! .Sh SYNOPSIS
! .Nm sccs
! .Op Fl r
! .Op Fl d Ar path
! .Op Fl p Ar path
! .Ar command
! .Op flags
! .Op Ar
! .Sh DESCRIPTION
! .Nm Sccs
! is a front end to the
! .Li SCCS
! programs
! that
! helps them mesh more cleanly
! with
! the rest of UNIX.
! It
! also includes the capability to run
! .Dq set user id
! to another user
! to
! provide additional protection.
! .Pp
! Basically,
! .Nm sccs
! runs the command with the specified
! .Ar flags
! and
! .Ar args .
  Each argument is normally modified to be prepended with
! .Dq Li SCCS/s. .
! .Pp
! Flags to be interpreted by the
! .Nm sccs
! program must be before the
! .Ar command
! argument.
! Flags to be passed to the actual
! .Li SCCS
! program must come after the
! .Ar command
! argument.
  These flags are specific to the command and
  are discussed in the documentation for that command.
! .Pp
! Besides the usual
! .Li SCCS
! commands,
! several
! .Dq pseudo-commands
! can be issued.
  These are:
  .Bl -tag -width deledit
  .It Cm edit
--- 31,77 ----
  .\"
  .\"	@(#)sccs.1	2.10 (Berkeley) 7/24/91
  .\"
! .TH SCCS 1 "BSD 4.2, July 24, 1991"
! .SH NAME
! sccs \-  front end for the SCCS subsystem
! .SH SYNOPSIS
! .B sccs
! [
! .B \-r
! ] [
! .BI \-d rootprefix
! ] [
! .BI \-p subdir
! ]
! .if n .ti +0.5i
! .I subcommand
! [
! .I option
! \&.\|.\|. ]
! [
! .I filename
! \&.\|.\|. ]
! 
! .SH DESCRIPTION
! Sccs is a front end to the \fBSCCS\fP programs that 
! helps them mesh more cleanly with the rest of UNIX.
! It also includes the capability to run \fIset user id\fP
! to another user to provide additional protection.
! .sp
! Basically, \fBsccs\fP runs the command with the specified
! flags and args.
  Each argument is normally modified to be prepended with
! \fISCCS/s.\fP .
! .sp
! Flags to be interpreted by the \fBsccs\fP program must be
! before the \fIcommand\fP argument.
! Flags to be passed to the actual \fISCCS\fP program must come
! after the \fIcommand\fP argument.
  These flags are specific to the command and
  are discussed in the documentation for that command.
! .sp
! Besides the usual \fISCCS\fP commands,
! several \fBpseudo-commands\fP can be issued.
  These are:
  .Bl -tag -width deledit
  .It Cm edit
*** sccs.bsd/sccs.c	Mon May 10 15:50:35 1993
--- sccs/sccs.c	Thu May 20 14:03:47 1993
***************
*** 41,47 ****
--- 41,49 ----
  static char sccsid[] = "@(#)sccs.c	5.11 (Berkeley) 3/4/91";
  #endif /* not lint */
  
+ #if defined(BSD4_4)
  #include <sys/cdefs.h>
+ #endif
  #include <sys/param.h>
  #include <sys/stat.h>
  #include <sys/dir.h>
***************
*** 52,57 ****
--- 54,65 ----
  #include <stdio.h>
  #include "pathnames.h"
  
+ #if defined(__STDC__)
+ typedef	void *	sig_t;
+ #else
+ typedef	int *	sig_t;
+ #endif
+ 
  /*
  **  SCCS.C -- human-oriented front end to the SCCS system.
  **
***************
*** 150,160 ****
  
  # ifndef SCCSPATH
  # define SCCSPATH	"SCCS"	/* pathname in which to find s-files */
! # endif NOT SCCSPATH
  
  # ifndef MYNAME
  # define MYNAME		"sccs"	/* name used for printing errors */
! # endif NOT MYNAME
  
  /****************  End of Configuration Information  ****************/
  
--- 158,168 ----
  
  # ifndef SCCSPATH
  # define SCCSPATH	"SCCS"	/* pathname in which to find s-files */
! # endif
  
  # ifndef MYNAME
  # define MYNAME		"sccs"	/* name used for printing errors */
! # endif
  
  /****************  End of Configuration Information  ****************/
  
***************
*** 167,174 ****
  struct sccsprog
  {
  	char	*sccsname;	/* name of SCCS routine */
! 	short	sccsoper;	/* opcode, see below */
! 	short	sccsflags;	/* flags, see below */
  	char	*sccspath;	/* pathname of binary implementing */
  };
  
--- 175,182 ----
  struct sccsprog
  {
  	char	*sccsname;	/* name of SCCS routine */
! 	int	sccsoper;	/* opcode, see below */
! 	int	sccsflags;	/* flags, see below */
  	char	*sccspath;	/* pathname of binary implementing */
  };
  
***************
*** 203,246 ****
  */
  
  struct sccsprog SccsProg[] = {
! 	"admin",	PROG,	REALUSER,	_PATH_SCCSADMIN,
! 	"cdc",		PROG,	0,		_PATH_SCCSRMDEL,
! 	"comb",		PROG,	0,		_PATH_SCCSCOMB,
! 	"delta",	PROG,	0,		_PATH_SCCSDELTA,
! 	"get",		PROG,	0,		_PATH_SCCSGET,
! 	"help",		PROG,	NO_SDOT,	_PATH_SCCSHELP,
! 	"prs",		PROG,	0,		_PATH_SCCSPRS,
! 	"prt",		PROG,	0,		_PATH_SCCSPRT,
! 	"rmdel",	PROG,	REALUSER,	_PATH_SCCSRMDEL,
! 	"val",		PROG,	0,		_PATH_SCCSVAL,
! 	"what",		PROG,	NO_SDOT,	_PATH_SCCSWHAT,
! 	"sccsdiff",	SHELL,	REALUSER,	_PATH_SCCSDIFF,
! 	"edit",		CMACRO,	NO_SDOT,	"get -e",
! 	"delget",	CMACRO,	NO_SDOT,	"delta:mysrp/get:ixbeskcl -t",
! 	"deledit",	CMACRO,	NO_SDOT,
! 					"delta:mysrp -n/get:ixbskcl -e -t -g",
! 	"fix",		FIX,	NO_SDOT,	NULL,
! 	"clean",	CLEAN,	REALUSER|NO_SDOT,
! 						(char *) CLEANC,
! 	"info",		CLEAN,	REALUSER|NO_SDOT,
! 						(char *) INFOC,
! 	"check",	CLEAN,	REALUSER|NO_SDOT,
! 						(char *) CHECKC,
! 	"tell",		CLEAN,	REALUSER|NO_SDOT,
! 						(char *) TELLC,
! 	"unedit",	UNEDIT,	NO_SDOT,	NULL,
! 	"diffs",	DIFFS,	NO_SDOT|REALUSER,
! 						NULL,
! 	"-diff",	DODIFF,	NO_SDOT|REALUSER,
! 						_PATH_SCCSBDIFF,
! 	"print",	CMACRO,	0,		"prs -e/get -p -m -s",
! 	"branch",	CMACRO,	NO_SDOT,
! 	    "get:ixrc -e -b/delta: -s -n -ybranch-place-holder/get:pl -e -t -g",
! 	"enter",	ENTER,	NO_SDOT,	NULL,
! 	"create",	CMACRO,	NO_SDOT,	"enter/get:ixbeskcl -t",
! 	NULL,		-1,	0,		NULL
  };
  
  /* one line from a p-file */
  struct pfile
  {
--- 211,261 ----
  */
  
  struct sccsprog SccsProg[] = {
! 	{"admin",	PROG,	REALUSER,	_PATH_SCCSADMIN},
! 	{"cdc",		PROG,	0,		_PATH_SCCSRMDEL},
! 	{"comb",	PROG,	0,		_PATH_SCCSCOMB},
! 	{"delta",	PROG,	0,		_PATH_SCCSDELTA},
! 	{"get",		PROG,	0,		_PATH_SCCSGET},
! 	{"help",	PROG,	NO_SDOT,	_PATH_SCCSHELP},
! 	{"prs",		PROG,	0,		_PATH_SCCSPRS},
! 	{"prt",		PROG,	0,		_PATH_SCCSPRT},
! 	{"rmdel",	PROG,	REALUSER,	_PATH_SCCSRMDEL},
! 	{"val",		PROG,	0,		_PATH_SCCSVAL},
! 	{"what",	PROG,	NO_SDOT,	_PATH_SCCSWHAT},
! 	{"sccsdiff",	SHELL,	REALUSER,	_PATH_SCCSDIFF},
! 	{"edit",	CMACRO,	NO_SDOT,	"get -e"},
! 	{"delget",	CMACRO,	NO_SDOT,	"delta:mysrp/get:ixbeskcl -t"},
! 	{"deledit",	CMACRO,	NO_SDOT,
! 				"delta:mysrp -n/get:ixbskcl -e -t -g"},
! 	{"fix",		FIX,	NO_SDOT,	NULL},
! 	{"clean",	CLEAN,	REALUSER|NO_SDOT,
! 						(char *) CLEANC},
! 	{"info",	CLEAN,	REALUSER|NO_SDOT,
! 						(char *) INFOC},
! 	{"check",	CLEAN,	REALUSER|NO_SDOT,
! 						(char *) CHECKC},
! 	{"tell",	CLEAN,	REALUSER|NO_SDOT,
! 						(char *) TELLC},
! 	{"unedit",	UNEDIT,	NO_SDOT,	NULL},
! 	{"diffs",	DIFFS,	NO_SDOT|REALUSER,
! 						NULL},
! 	{"-diff",	DODIFF,	NO_SDOT|REALUSER,
! 						_PATH_SCCSBDIFF},
! 	{"print",	CMACRO,	0,		"prs -e/get -p -m -s"},
! 	{"branch",	CMACRO,	NO_SDOT,
! 	    "get:ixrc -e -b/delta: -s -n -ybranch-place-holder/get:pl -e -t -g"},
! 	{"enter",	ENTER,	NO_SDOT,	NULL},
! 	{"create",	CMACRO,	NO_SDOT,	"enter/get:ixbeskcl -t"},
! /*	{NULL,		-1,	0,		NULL},	    */
  };
  
+ #ifndef	__STDC__
+ #  define const  /**/
+ #endif
+ 
+ static unsigned int
+     NumOfSccsProgs = sizeof(SccsProg)/sizeof(SccsProg[0]);
+ 
  /* one line from a p-file */
  struct pfile
  {
***************
*** 252,263 ****
  	char	*p_aux;		/* extra info at end */
  };
  
! char	*SccsPath = SCCSPATH;	/* pathname of SCCS files */
  # ifdef SCCSDIR
! char	*SccsDir = SCCSDIR;	/* directory to begin search from */
  # else
! char	*SccsDir = "";
  # endif
  char	MyName[] = MYNAME;	/* name used in messages */
  int	OutFile = -1;		/* override output file for commands */
  bool	RealUser;		/* if set, running as real user */
--- 267,280 ----
  	char	*p_aux;		/* extra info at end */
  };
  
! char	DefSccsPath[] = SCCSPATH;   /* pathname of SCCS files */
! char	*SccsPath = DefSccsPath;
  # ifdef SCCSDIR
! char	DefSccsDir[] = SCCSDIR;	/* directory to begin search from */
  # else
! char	DefSccsDir[] = "";
  # endif
+ char    *SccsDir = DefSccsDir;
  char	MyName[] = MYNAME;	/* name used in messages */
  int	OutFile = -1;		/* override output file for commands */
  bool	RealUser;		/* if set, running as real user */
***************
*** 266,272 ****
  # endif
  # ifndef V6
  extern char	*getenv();
! # endif V6
  
  extern char	*sys_siglist[];
  
--- 283,289 ----
  # endif
  # ifndef V6
  extern char	*getenv();
! # endif
  
  extern char	*sys_siglist[];
  
***************
*** 318,325 ****
  			SccsDir = buf;
  		}
  	}
! # endif SCCSDIR
! # endif V6
  
  	/*
  	**  Detect and decode flags intended for this program.
--- 335,342 ----
  			SccsDir = buf;
  		}
  	}
! # endif
! # endif
  
  	/*
  	**  Detect and decode flags intended for this program.
***************
*** 467,474 ****
  	cmd = lookup(*ap);
  	if (cmd == NULL)
  	{
  		usrerr("Unknown command \"%s\"", *ap);
! 		return (EX_USAGE);
  	}
  
  	/*
--- 484,496 ----
  	cmd = lookup(*ap);
  	if (cmd == NULL)
  	{
+ 	    if (! *ap) {
+ 		usrerr("No sccs command specified.");
+ 	    }
+ 	    else {
  		usrerr("Unknown command \"%s\"", *ap);
! 	    }
! 	    return (EX_USAGE);
  	}
  
  	/*
***************
*** 658,671 ****
  lookup(name)
  	char *name;
  {
! 	register struct sccsprog *cmd;
  
! 	for (cmd = SccsProg; cmd->sccsname != NULL; cmd++)
! 	{
! 		if (strcmp(cmd->sccsname, name) == 0)
! 			return (cmd);
  	}
! 	return (NULL);
  }
  
  /*
--- 680,697 ----
  lookup(name)
  	char *name;
  {
! 	register unsigned int	i;
  
! 	if (! name || !strlen (name)) {
! 	    return ((struct sccsprog *) 0);
  	}
! 
! 	for (i = 0; i < NumOfSccsProgs; i++) {
! 	    if (!strcmp (SccsProg[i].sccsname, name)) {
! 		return (&SccsProg[i]);
! 	    }
! 	}
! 	return ((struct sccsprog *) 0);
  }
  
  /*
***************
*** 746,753 ****
  						sigmsg = sys_siglist[sigcode];
  					else
  					{
! 						sprintf(sigmsgbuf, "Signal %d",
! 						    sigcode);
  						sigmsg = sigmsgbuf;
  					}
  					fprintf(stderr, "sccs: %s: %s%s", argv[0],
--- 772,780 ----
  						sigmsg = sys_siglist[sigcode];
  					else
  					{
! 						sprintf(sigmsgbuf,
! 							"Signal %d",
! 							sigcode);
  						sigmsg = sigmsgbuf;
  					}
  					fprintf(stderr, "sccs: %s: %s%s", argv[0],
***************
*** 787,792 ****
--- 814,821 ----
  	syserr("cannot execute %s", progpath);
  	exit(EX_UNAVAILABLE);
  	/*NOTREACHED*/
+ 
+ 	return (-1);	/* We will never get here. */
  }
  
  /*
***************
*** 1340,1346 ****
  	register int pid;
  	auto int st;
  	extern int errno;
! 	sig_t osig;
  
  	printf("\n------- %s -------\n", gfile);
  	fflush(stdout);
--- 1369,1379 ----
  	register int pid;
  	auto int st;
  	extern int errno;
! #ifdef	__convex__
! 	_SigFunc_Ptr_t	osig;
! #else
! 	sig_t	osig;
! #endif
  
  	printf("\n------- %s -------\n", gfile);
  	fflush(stdout);
***************
*** 1578,1584 ****
  	if (p == NULL || p[0] == '\0')
  		p = getlogin();
  	return (p);
! # endif UIDUSER
  }
  
  /*
--- 1611,1617 ----
  	if (p == NULL || p[0] == '\0')
  		p = getlogin();
  	return (p);
! # endif
  }
  
  /*
