mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-30 20:35:03 +01:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95b66175a3 |
No files matched your search
@@ -1,4 +1,3 @@
|
||||
# $Id:$
|
||||
# @(#)COPYRIGHT 8.2 (Berkeley) 3/21/94
|
||||
|
||||
All of the documentation and software included in the 4.4BSD and 4.4BSD-Lite
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# $Id: Makefile,v 1.109.2.34 1998/09/04 06:07:43 jkh Exp $
|
||||
# $Id: Makefile,v 1.109.2.32 1998/06/29 10:15:32 jkh Exp $
|
||||
#
|
||||
# Make command line options:
|
||||
# -DCLOBBER will remove /usr/include
|
||||
@@ -525,7 +525,6 @@ lib-tools:
|
||||
usr.bin/tsort \
|
||||
gnu/usr.bin/as \
|
||||
gnu/usr.bin/bison \
|
||||
gnu/usr.bin/awk \
|
||||
usr.bin/ar \
|
||||
usr.bin/compile_et \
|
||||
usr.bin/lex/lib \
|
||||
@@ -629,7 +628,6 @@ build-tools:
|
||||
bin/date \
|
||||
bin/dd \
|
||||
bin/echo \
|
||||
usr.bin/yacc \
|
||||
bin/expr \
|
||||
bin/hostname \
|
||||
bin/ln \
|
||||
@@ -638,6 +636,7 @@ build-tools:
|
||||
bin/mv \
|
||||
bin/rm \
|
||||
bin/test \
|
||||
gnu/usr.bin/awk \
|
||||
gnu/usr.bin/bc \
|
||||
gnu/usr.bin/grep \
|
||||
gnu/usr.bin/groff \
|
||||
@@ -675,6 +674,7 @@ build-tools:
|
||||
usr.bin/vgrind \
|
||||
usr.bin/vi \
|
||||
usr.bin/wc \
|
||||
usr.bin/yacc \
|
||||
usr.sbin/chown \
|
||||
usr.sbin/mtree \
|
||||
usr.sbin/zic \
|
||||
|
||||
+4
-6
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)cp.1 8.3 (Berkeley) 4/18/94
|
||||
.\" $Id: cp.1,v 1.6.2.2 1998/07/15 02:01:05 jkh Exp $
|
||||
.\" $Id: cp.1,v 1.6.2.1 1997/02/28 07:54:27 mpp Exp $
|
||||
.\"
|
||||
.Dd April 18, 1994
|
||||
.Dt CP 1
|
||||
@@ -143,15 +143,13 @@ be preserved, the set group ID bit is not preserved
|
||||
in the copy's permissions.
|
||||
If the source file has both its set user ID and set group ID bits on,
|
||||
and either the user ID or group ID cannot be preserved, neither
|
||||
the set user ID nor set group ID bits are preserved in the copy's
|
||||
the set user ID or set group ID bits are preserved in the copy's
|
||||
permissions.
|
||||
.El
|
||||
.Pp
|
||||
For each destination file that already exists, its contents are
|
||||
overwritten if permissions allow. Its mode, user ID, and group
|
||||
ID are unchanged unless the
|
||||
.Fl p
|
||||
option was specified.
|
||||
overwritten if permissions allow, but its mode, user ID, and group
|
||||
ID are unchanged.
|
||||
.Pp
|
||||
In the second synopsis form,
|
||||
.Ar target_directory
|
||||
|
||||
+4
-2
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)ls.1 8.6 (Berkeley) 4/18/94
|
||||
.\" $Id: ls.1,v 1.5.2.6 1998/07/15 02:01:34 jkh Exp $
|
||||
.\" $Id: ls.1,v 1.5.2.5 1997/12/25 09:35:55 hoek Exp $
|
||||
.\"
|
||||
.Dd April 18, 1994
|
||||
.Dt LS 1
|
||||
@@ -43,7 +43,7 @@
|
||||
.Nd list directory contents
|
||||
.Sh SYNOPSIS
|
||||
.Nm ls
|
||||
.Op Fl ABCFHLPRTabcdfgikloqrstu1
|
||||
.Op Fl ABCFHLPRTWabcdfgikloqrstu1
|
||||
.Op Ar file ...
|
||||
.Sh DESCRIPTION
|
||||
For each operand that names a
|
||||
@@ -115,6 +115,8 @@ Recursively list subdirectories encountered.
|
||||
.It Fl T
|
||||
Display complete time information for the file, including
|
||||
month, day, hour, minute, second, and year.
|
||||
.It Fl W
|
||||
Display whiteouts when scanning directories.
|
||||
.It Fl a
|
||||
Include directory entries whose names begin with a
|
||||
dot (.).
|
||||
|
||||
+2
-2
@@ -33,7 +33,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ls.c,v 1.10.2.2 1998/07/15 02:01:34 jkh Exp $
|
||||
* $Id: ls.c,v 1.10.2.1 1997/12/03 05:40:06 imp Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -131,7 +131,7 @@ main(argc, argv)
|
||||
f_listdot = 1;
|
||||
|
||||
fts_options = FTS_PHYSICAL;
|
||||
while ((ch = getopt(argc, argv, "1ABCFHLPRTabcdfgikloqrstu")) != -1) {
|
||||
while ((ch = getopt(argc, argv, "1ABCFHLPRTWabcdfgikloqrstu")) != -1) {
|
||||
switch (ch) {
|
||||
/*
|
||||
* The -1, -C and -l options all override each other so shell
|
||||
|
||||
+2
-2
@@ -33,7 +33,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: util.c,v 1.5.2.2 1998/07/15 02:01:36 jkh Exp $
|
||||
* $Id: util.c,v 1.5.2.1 1997/03/26 17:55:19 obrien Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -154,7 +154,7 @@ prn_octal(s)
|
||||
void
|
||||
usage()
|
||||
{
|
||||
(void)fprintf(stderr, "usage: ls [-ACFHLPRTacdfgikloqrstu1]"
|
||||
(void)fprintf(stderr, "usage: ls [-ACFHLPRTWacdfgikloqrstu1]"
|
||||
" [file ...]\n");
|
||||
exit(1);
|
||||
}
|
||||
+3
-2
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: keyword.c,v 1.9.2.1 1998/06/04 22:20:31 steve Exp $
|
||||
* $Id: keyword.c,v 1.9 1996/07/31 09:27:23 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -345,7 +345,8 @@ findvar(p)
|
||||
if (!v) {
|
||||
warnx("%s: keyword not found", p);
|
||||
eval = 1;
|
||||
} else if (hp)
|
||||
}
|
||||
if (hp)
|
||||
v->header = hp;
|
||||
return (v);
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
# @(#)TOUR 8.1 (Berkeley) 5/31/93
|
||||
# $Id: TOUR,v 1.5 1997/02/22 13:58:19 peter Exp $
|
||||
# $Id: TOUR,v 1.2 1994/09/24 02:57:19 davidg Exp $
|
||||
|
||||
NOTE -- This is the original TOUR paper distributed with ash and
|
||||
does not represent the current state of the shell. It is provided anyway
|
||||
|
||||
+3
-5
@@ -32,14 +32,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: alias.c,v 1.4 1996/09/01 10:19:26 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)alias.c 8.3 (Berkeley) 5/4/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: alias.c,v 1.10 1998/05/18 06:43:25 charnier Exp $";
|
||||
static char const sccsid[] = "@(#)alias.c 8.3 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)alias.h 8.2 (Berkeley) 5/4/95
|
||||
* $Id: alias.h,v 1.5 1997/02/22 13:58:20 peter Exp $
|
||||
* $Id: alias.h,v 1.2 1994/09/24 02:57:20 davidg Exp $
|
||||
*/
|
||||
|
||||
#define ALIASINUSE 1
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)arith.h 1.1 (Berkeley) 5/4/95
|
||||
* $Id: arith.h,v 1.4 1997/02/22 13:58:20 peter Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
int arith __P((char *));
|
||||
|
||||
+2
-9
@@ -88,15 +88,11 @@ expr: ARITH_LPAREN expr ARITH_RPAREN = { $$ = $2; }
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: arith.y,v 1.9 1998/08/25 09:33:34 cracauer Exp $
|
||||
* $Id: arith.y,v 1.3 1996/09/01 10:19:38 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)arith.y 8.3 (Berkeley) 5/4/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: arith.y,v 1.9 1998/08/25 09:33:34 cracauer Exp $";
|
||||
static char const sccsid[] = "@(#)arith.y 8.3 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "shell.h"
|
||||
@@ -107,9 +103,6 @@ static const char rcsid[] =
|
||||
char *arith_buf, *arith_startbuf;
|
||||
extern void arith_lex_reset();
|
||||
|
||||
int yylex __P((void));
|
||||
int yyparse __P((void));
|
||||
|
||||
int
|
||||
arith(s)
|
||||
char *s;
|
||||
|
||||
+2
-6
@@ -34,15 +34,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: arith_lex.l,v 1.12 1998/08/25 09:33:34 cracauer Exp $
|
||||
* $Id: arith_lex.l,v 1.5 1996/09/01 10:19:41 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)arith_lex.l 8.3 (Berkeley) 5/4/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: arith_lex.l,v 1.12 1998/08/25 09:33:34 cracauer Exp $";
|
||||
static char const sccsid[] = "@(#)arith_lex.l 8.3 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
# SUCH DAMAGE.
|
||||
#
|
||||
# @(#)builtins.def 8.4 (Berkeley) 5/4/95
|
||||
# $Id: builtins.def,v 1.6 1997/04/28 03:50:07 steve Exp $
|
||||
# $Id: builtins.def,v 1.3 1996/10/01 04:59:13 peter Exp $
|
||||
|
||||
#
|
||||
# This file lists all the builtin commands. The first column is the name
|
||||
|
||||
+19
-160
@@ -32,14 +32,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: cd.c,v 1.6 1996/09/01 10:19:47 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)cd.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: cd.c,v 1.18 1998/09/06 21:01:57 tegge Exp $";
|
||||
static char const sccsid[] = "@(#)cd.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -106,7 +104,7 @@ cdcmd(argc, argv)
|
||||
/*
|
||||
* XXX - rethink
|
||||
*/
|
||||
if (p[0] == '.' && p[1] == '/' && p[2] != '\0')
|
||||
if (p[0] == '.' && p[1] == '/')
|
||||
p += 2;
|
||||
print = strcmp(p, dest);
|
||||
}
|
||||
@@ -130,58 +128,22 @@ docd(dest, print)
|
||||
char *dest;
|
||||
int print;
|
||||
{
|
||||
char *p;
|
||||
char *q;
|
||||
char *component;
|
||||
struct stat statb;
|
||||
int first;
|
||||
int badstat;
|
||||
|
||||
TRACE(("docd(\"%s\", %d) called\n", dest, print));
|
||||
|
||||
/*
|
||||
* Check each component of the path. If we find a symlink or
|
||||
* something we can't stat, clear curdir to force a getcwd()
|
||||
* next time we get the value of the current directory.
|
||||
*/
|
||||
badstat = 0;
|
||||
cdcomppath = stalloc(strlen(dest) + 1);
|
||||
scopy(dest, cdcomppath);
|
||||
STARTSTACKSTR(p);
|
||||
if (*dest == '/') {
|
||||
STPUTC('/', p);
|
||||
cdcomppath++;
|
||||
}
|
||||
first = 1;
|
||||
while ((q = getcomponent()) != NULL) {
|
||||
if (q[0] == '\0' || (q[0] == '.' && q[1] == '\0'))
|
||||
continue;
|
||||
if (! first)
|
||||
STPUTC('/', p);
|
||||
first = 0;
|
||||
component = q;
|
||||
while (*q)
|
||||
STPUTC(*q++, p);
|
||||
if (equal(component, ".."))
|
||||
continue;
|
||||
STACKSTRNUL(p);
|
||||
if ((lstat(stackblock(), &statb) < 0)
|
||||
|| (S_ISLNK(statb.st_mode))) {
|
||||
/* print = 1; */
|
||||
badstat = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
INTOFF;
|
||||
if (chdir(dest) < 0) {
|
||||
updatepwd(dest);
|
||||
if (chdir(stackblock()) < 0) {
|
||||
INTON;
|
||||
return -1;
|
||||
}
|
||||
updatepwd(badstat ? NULL : dest);
|
||||
hashcd(); /* update command hash table */
|
||||
if (prevdir)
|
||||
ckfree(prevdir);
|
||||
prevdir = curdir;
|
||||
curdir = savestr(stackblock());
|
||||
INTON;
|
||||
if (print && iflag && curdir)
|
||||
out1fmt("%s\n", curdir);
|
||||
if (print && iflag)
|
||||
out1fmt("%s\n", stackblock());
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -212,9 +174,8 @@ getcomponent()
|
||||
|
||||
|
||||
/*
|
||||
* Update curdir (the name of the current directory) in response to a
|
||||
* cd command. We also call hashcd to let the routines in exec.c know
|
||||
* that the current directory has changed.
|
||||
* Determine the new working directory, but don't actually enforce
|
||||
* any changes.
|
||||
*/
|
||||
STATIC void
|
||||
updatepwd(dir)
|
||||
@@ -223,30 +184,12 @@ updatepwd(dir)
|
||||
char *new;
|
||||
char *p;
|
||||
|
||||
hashcd(); /* update command hash table */
|
||||
|
||||
/*
|
||||
* If our argument is NULL, we don't know the current directory
|
||||
* any more because we traversed a symbolic link or something
|
||||
* we couldn't stat().
|
||||
*/
|
||||
if (dir == NULL || curdir == NULL) {
|
||||
if (prevdir)
|
||||
ckfree(prevdir);
|
||||
INTOFF;
|
||||
prevdir = curdir;
|
||||
curdir = NULL;
|
||||
if (getpwd() == NULL)
|
||||
error("getcwd() failed: %s", strerror(errno));
|
||||
setvar("PWD", curdir, VEXPORT | VTEXTFIXED);
|
||||
setvar("OLDPWD", prevdir, VEXPORT | VTEXTFIXED);
|
||||
INTON;
|
||||
return;
|
||||
}
|
||||
cdcomppath = stalloc(strlen(dir) + 1);
|
||||
scopy(dir, cdcomppath);
|
||||
STARTSTACKSTR(new);
|
||||
if (*dir != '/') {
|
||||
if (curdir == NULL)
|
||||
return;
|
||||
p = curdir;
|
||||
while (*p)
|
||||
STPUTC(*p++, new);
|
||||
@@ -265,14 +208,6 @@ updatepwd(dir)
|
||||
if (new == stackblock())
|
||||
STPUTC('/', new);
|
||||
STACKSTRNUL(new);
|
||||
INTOFF;
|
||||
if (prevdir)
|
||||
ckfree(prevdir);
|
||||
prevdir = curdir;
|
||||
curdir = savestr(stackblock());
|
||||
setvar("PWD", curdir, VEXPORT | VTEXTFIXED);
|
||||
setvar("OLDPWD", prevdir, VEXPORT | VTEXTFIXED);
|
||||
INTON;
|
||||
}
|
||||
|
||||
|
||||
@@ -289,10 +224,6 @@ pwdcmd(argc, argv)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#define MAXPWD 256
|
||||
|
||||
/*
|
||||
* Find out what the current directory is. If we already know the current
|
||||
* directory, this routine returns immediately.
|
||||
@@ -300,79 +231,7 @@ pwdcmd(argc, argv)
|
||||
char *
|
||||
getpwd()
|
||||
{
|
||||
char buf[MAXPWD];
|
||||
|
||||
if (curdir)
|
||||
return curdir;
|
||||
/*
|
||||
* Things are a bit complicated here; we could have just used
|
||||
* getcwd, but traditionally getcwd is implemented using popen
|
||||
* to /bin/pwd. This creates a problem for us, since we cannot
|
||||
* keep track of the job if it is being ran behind our backs.
|
||||
* So we re-implement getcwd(), and we suppress interrupts
|
||||
* throughout the process. This is not completely safe, since
|
||||
* the user can still break out of it by killing the pwd program.
|
||||
* We still try to use getcwd for systems that we know have a
|
||||
* c implementation of getcwd, that does not open a pipe to
|
||||
* /bin/pwd.
|
||||
*/
|
||||
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__SVR4)
|
||||
|
||||
if (getcwd(buf, sizeof(buf)) == NULL) {
|
||||
char *pwd = getenv("PWD");
|
||||
struct stat stdot, stpwd;
|
||||
|
||||
if (pwd && *pwd == '/' && stat(".", &stdot) != -1 &&
|
||||
stat(pwd, &stpwd) != -1 &&
|
||||
stdot.st_dev == stpwd.st_dev &&
|
||||
stdot.st_ino == stpwd.st_ino) {
|
||||
curdir = savestr(pwd);
|
||||
return curdir;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
curdir = savestr(buf);
|
||||
#else
|
||||
{
|
||||
char *p;
|
||||
int i;
|
||||
int status;
|
||||
struct job *jp;
|
||||
int pip[2];
|
||||
|
||||
INTOFF;
|
||||
if (pipe(pip) < 0)
|
||||
error("Pipe call failed");
|
||||
jp = makejob((union node *)NULL, 1);
|
||||
if (forkshell(jp, (union node *)NULL, FORK_NOJOB) == 0) {
|
||||
(void) close(pip[0]);
|
||||
if (pip[1] != 1) {
|
||||
close(1);
|
||||
copyfd(pip[1], 1);
|
||||
close(pip[1]);
|
||||
}
|
||||
(void) execl("/bin/pwd", "pwd", (char *)0);
|
||||
error("Cannot exec /bin/pwd");
|
||||
}
|
||||
(void) close(pip[1]);
|
||||
pip[1] = -1;
|
||||
p = buf;
|
||||
while ((i = read(pip[0], p, buf + MAXPWD - p)) > 0
|
||||
|| (i == -1 && errno == EINTR)) {
|
||||
if (i > 0)
|
||||
p += i;
|
||||
}
|
||||
(void) close(pip[0]);
|
||||
pip[0] = -1;
|
||||
status = waitforjob(jp);
|
||||
if (status != 0)
|
||||
error((char *)0);
|
||||
if (i < 0 || p == buf || p[-1] != '\n')
|
||||
error("pwd command failed");
|
||||
p[-1] = '\0';
|
||||
}
|
||||
curdir = savestr(buf);
|
||||
INTON;
|
||||
#endif
|
||||
return curdir;
|
||||
return (curdir);
|
||||
return ((curdir = getcwd(NULL, 0)));
|
||||
}
|
||||
+2
-4
@@ -30,9 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: cd.h,v 1.4 1998/09/06 21:01:57 tegge Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
char *getpwd __P((void));
|
||||
int cdcmd __P((int, char **));
|
||||
int pwdcmd __P((int, char **));
|
||||
char *getpwd __P((void));
|
||||
+14
-32
@@ -32,14 +32,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: error.c,v 1.5 1996/09/03 14:15:46 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)error.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: error.c,v 1.13 1998/08/25 09:33:34 cracauer Exp $";
|
||||
static char const sccsid[] = "@(#)error.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@@ -52,7 +50,6 @@ static const char rcsid[] =
|
||||
#include "output.h"
|
||||
#include "error.h"
|
||||
#include "show.h"
|
||||
#include "trap.h"
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
@@ -63,9 +60,9 @@ static const char rcsid[] =
|
||||
*/
|
||||
|
||||
struct jmploc *handler;
|
||||
volatile sig_atomic_t exception;
|
||||
volatile sig_atomic_t suppressint;
|
||||
volatile sig_atomic_t intpending;
|
||||
int exception;
|
||||
volatile int suppressint;
|
||||
volatile int intpending;
|
||||
char *commandname;
|
||||
|
||||
|
||||
@@ -92,43 +89,28 @@ exraise(e)
|
||||
* Called from trap.c when a SIGINT is received. (If the user specifies
|
||||
* that SIGINT is to be trapped or ignored using the trap builtin, then
|
||||
* this routine is not called.) Suppressint is nonzero when interrupts
|
||||
* are held using the INTOFF macro. If SIGINTs are not suppressed and
|
||||
* the shell is not a root shell, then we want to be terminated if we
|
||||
* get here, as if we were terminated directly by a SIGINT. Arrange for
|
||||
* this here.
|
||||
* are held using the INTOFF macro. The call to _exit is necessary because
|
||||
* there is a short period after a fork before the signal handlers are
|
||||
* set to the appropriate value for the child. (The test for iflag is
|
||||
* just defensive programming.)
|
||||
*/
|
||||
|
||||
void
|
||||
onint() {
|
||||
sigset_t sigset;
|
||||
|
||||
/*
|
||||
* The !in_dotrap here is safe. The only way we can arrive here
|
||||
* with in_dotrap set is that a trap handler set SIGINT to SIG_DFL
|
||||
* and killed itself.
|
||||
*/
|
||||
|
||||
if (suppressint && !in_dotrap) {
|
||||
if (suppressint) {
|
||||
intpending++;
|
||||
return;
|
||||
}
|
||||
intpending = 0;
|
||||
sigemptyset(&sigset);
|
||||
sigprocmask(SIG_SETMASK, &sigset, NULL);
|
||||
|
||||
/*
|
||||
* This doesn't seem to be needed, since main() emits a newline.
|
||||
*/
|
||||
#if 0
|
||||
if (tcgetpgrp(0) == getpid())
|
||||
write(STDERR_FILENO, "\n", 1);
|
||||
#endif
|
||||
out2str("\n");
|
||||
if (rootshell && iflag)
|
||||
exraise(EXINT);
|
||||
else {
|
||||
signal(SIGINT, SIG_DFL);
|
||||
kill(getpid(), SIGINT);
|
||||
}
|
||||
else
|
||||
_exit(128 + SIGINT);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+4
-5
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)error.h 8.2 (Berkeley) 5/4/95
|
||||
* $Id: error.h,v 1.9 1998/08/24 19:15:48 cracauer Exp $
|
||||
* $Id: error.h,v 1.4 1996/09/03 14:15:48 peter Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -57,14 +57,13 @@
|
||||
*/
|
||||
|
||||
#include <setjmp.h>
|
||||
#include <signal.h>
|
||||
|
||||
struct jmploc {
|
||||
jmp_buf loc;
|
||||
};
|
||||
|
||||
extern struct jmploc *handler;
|
||||
extern volatile sig_atomic_t exception;
|
||||
extern int exception;
|
||||
|
||||
/* exceptions */
|
||||
#define EXINT 0 /* SIGINT received */
|
||||
@@ -80,8 +79,8 @@ extern volatile sig_atomic_t exception;
|
||||
* more fun than worrying about efficiency and portability. :-))
|
||||
*/
|
||||
|
||||
extern volatile sig_atomic_t suppressint;
|
||||
extern volatile sig_atomic_t intpending;
|
||||
extern volatile int suppressint;
|
||||
extern volatile int intpending;
|
||||
extern char *commandname; /* name of command--printed on error */
|
||||
|
||||
#define INTOFF suppressint++
|
||||
|
||||
+3
-5
@@ -32,14 +32,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: eval.c,v 1.7.2.3 1997/08/25 09:09:42 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: eval.c,v 1.15 1998/05/18 06:43:34 charnier Exp $";
|
||||
static char const sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)eval.h 8.2 (Berkeley) 5/4/95
|
||||
* $Id: eval.h,v 1.6 1997/02/22 13:58:24 peter Exp $
|
||||
* $Id: eval.h,v 1.3 1996/09/01 10:19:59 peter Exp $
|
||||
*/
|
||||
|
||||
extern char *commandname; /* currently executing command */
|
||||
|
||||
+3
-5
@@ -32,14 +32,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: exec.c,v 1.6 1996/09/03 14:15:49 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)exec.c 8.4 (Berkeley) 6/8/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: exec.c,v 1.12 1998/05/18 06:43:37 charnier Exp $";
|
||||
static char const sccsid[] = "@(#)exec.c 8.4 (Berkeley) 6/8/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)exec.h 8.3 (Berkeley) 6/8/95
|
||||
* $Id: exec.h,v 1.7 1997/04/28 03:08:38 steve Exp $
|
||||
* $Id: exec.h,v 1.3 1996/09/01 10:20:05 peter Exp $
|
||||
*/
|
||||
|
||||
/* values of cmdtype */
|
||||
|
||||
+43
-161
@@ -32,14 +32,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: expand.c,v 1.11.2.4 1997/06/19 17:57:30 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)expand.c 8.5 (Berkeley) 5/15/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: expand.c,v 1.24 1998/09/13 19:24:57 tegge Exp $";
|
||||
static char const sccsid[] = "@(#)expand.c 8.5 (Berkeley) 5/15/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -51,7 +49,6 @@ static const char rcsid[] =
|
||||
#include <pwd.h>
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
* Routines to expand arguments to commands. We have to deal with
|
||||
@@ -103,7 +100,6 @@ STATIC char *evalvar __P((char *, int));
|
||||
STATIC int varisset __P((char *, int));
|
||||
STATIC void varvalue __P((char *, int, int));
|
||||
STATIC void recordregion __P((int, int, int));
|
||||
STATIC void removerecordregions __P((int));
|
||||
STATIC void ifsbreakup __P((char *, struct arglist *));
|
||||
STATIC void expandmeta __P((struct strlist *, int));
|
||||
STATIC void expmeta __P((char *, char *));
|
||||
@@ -228,13 +224,6 @@ argstr(p, flag)
|
||||
case '\0':
|
||||
case CTLENDVAR: /* ??? */
|
||||
goto breakloop;
|
||||
case CTLQUOTEMARK:
|
||||
/* "$@" syntax adherence hack */
|
||||
if (p[0] == CTLVAR && p[2] == '@' && p[3] == '=')
|
||||
break;
|
||||
if ((flag & EXP_FULL) != 0)
|
||||
STPUTC(c, expdest);
|
||||
break;
|
||||
case CTLESC:
|
||||
if (quotes)
|
||||
STPUTC(c, expdest);
|
||||
@@ -290,8 +279,6 @@ exptilde(p, flag)
|
||||
switch(c) {
|
||||
case CTLESC:
|
||||
return (startp);
|
||||
case CTLQUOTEMARK:
|
||||
return (startp);
|
||||
case ':':
|
||||
if (flag & EXP_VARTILDE)
|
||||
goto done;
|
||||
@@ -326,46 +313,6 @@ lose:
|
||||
}
|
||||
|
||||
|
||||
STATIC void
|
||||
removerecordregions(endoff)
|
||||
int endoff;
|
||||
{
|
||||
if (ifslastp == NULL)
|
||||
return;
|
||||
|
||||
if (ifsfirst.endoff > endoff) {
|
||||
while (ifsfirst.next != NULL) {
|
||||
struct ifsregion *ifsp;
|
||||
INTOFF;
|
||||
ifsp = ifsfirst.next->next;
|
||||
ckfree(ifsfirst.next);
|
||||
ifsfirst.next = ifsp;
|
||||
INTON;
|
||||
}
|
||||
if (ifsfirst.begoff > endoff)
|
||||
ifslastp = NULL;
|
||||
else {
|
||||
ifslastp = &ifsfirst;
|
||||
ifsfirst.endoff = endoff;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
ifslastp = &ifsfirst;
|
||||
while (ifslastp->next && ifslastp->next->begoff < endoff)
|
||||
ifslastp=ifslastp->next;
|
||||
while (ifslastp->next != NULL) {
|
||||
struct ifsregion *ifsp;
|
||||
INTOFF;
|
||||
ifsp = ifslastp->next->next;
|
||||
ckfree(ifslastp->next);
|
||||
ifslastp->next = ifsp;
|
||||
INTON;
|
||||
}
|
||||
if (ifslastp->endoff > endoff)
|
||||
ifslastp->endoff = endoff;
|
||||
}
|
||||
|
||||
/*
|
||||
* Expand arithmetic expression. Backup to start of expression,
|
||||
* evaluate, place result in (backed up) result, adjust string position.
|
||||
@@ -376,10 +323,17 @@ expari(flag)
|
||||
{
|
||||
char *p, *start;
|
||||
int result;
|
||||
int begoff;
|
||||
int quotes = flag & (EXP_FULL | EXP_CASE);
|
||||
int quoted;
|
||||
|
||||
while (ifsfirst.next != NULL) {
|
||||
struct ifsregion *ifsp;
|
||||
INTOFF;
|
||||
ifsp = ifsfirst.next->next;
|
||||
ckfree(ifsfirst.next);
|
||||
ifsfirst.next = ifsp;
|
||||
INTON;
|
||||
}
|
||||
ifslastp = NULL;
|
||||
|
||||
/*
|
||||
* This routine is slightly over-compilcated for
|
||||
@@ -406,21 +360,12 @@ expari(flag)
|
||||
for (p = start; *p != CTLARI; p++)
|
||||
if (*p == CTLESC)
|
||||
p++;
|
||||
|
||||
if (p[1] == '"')
|
||||
quoted=1;
|
||||
else
|
||||
quoted=0;
|
||||
begoff = p - start;
|
||||
removerecordregions(begoff);
|
||||
if (quotes)
|
||||
rmescapes(p+2);
|
||||
result = arith(p+2);
|
||||
rmescapes(p+1);
|
||||
result = arith(p+1);
|
||||
fmtstr(p, 12, "%d", result);
|
||||
while (*p++)
|
||||
;
|
||||
if (quoted == 0)
|
||||
recordregion(begoff, p - 1 - start, 0);
|
||||
result = expdest - p + 1;
|
||||
STADJUST(-result, expdest);
|
||||
}
|
||||
@@ -723,24 +668,19 @@ record:
|
||||
STPUTC('\0', expdest);
|
||||
pat = expdest;
|
||||
if (subevalvar(p, NULL, expdest - stackblock(), subtype,
|
||||
startloc, varflags) == 0) {
|
||||
startloc, varflags))
|
||||
goto record;
|
||||
else {
|
||||
int amount = (expdest - pat) + 1;
|
||||
STADJUST(-amount, expdest);
|
||||
}
|
||||
/* Remove any recorded regions beyond start of variable */
|
||||
removerecordregions(startloc);
|
||||
goto record;
|
||||
break;
|
||||
|
||||
case VSASSIGN:
|
||||
case VSQUESTION:
|
||||
if (!set) {
|
||||
if (subevalvar(p, var, 0, subtype, startloc, varflags)) {
|
||||
varflags &= ~VSNUL;
|
||||
/*
|
||||
* Remove any recorded regions beyond
|
||||
* start of variable
|
||||
*/
|
||||
removerecordregions(startloc);
|
||||
goto again;
|
||||
}
|
||||
break;
|
||||
@@ -874,23 +814,17 @@ numvar:
|
||||
}
|
||||
break;
|
||||
case '@':
|
||||
if (allow_split && quoted) {
|
||||
for (ap = shellparam.p ; (p = *ap++) != NULL ; ) {
|
||||
STRTODEST(p);
|
||||
if (*ap)
|
||||
STPUTC('\0', expdest);
|
||||
}
|
||||
break;
|
||||
if (allow_split) {
|
||||
sep = '\0';
|
||||
goto allargs;
|
||||
}
|
||||
/* fall through */
|
||||
case '*':
|
||||
if (ifsset() != 0)
|
||||
sep = ifsval()[0];
|
||||
else
|
||||
sep = ' ';
|
||||
sep = ' ';
|
||||
allargs:
|
||||
for (ap = shellparam.p ; (p = *ap++) != NULL ; ) {
|
||||
STRTODEST(p);
|
||||
if (*ap && sep)
|
||||
if (*ap)
|
||||
STPUTC(sep, expdest);
|
||||
}
|
||||
break;
|
||||
@@ -957,69 +891,45 @@ ifsbreakup(string, arglist)
|
||||
char *q;
|
||||
char *ifs;
|
||||
int ifsspc;
|
||||
int nulonly;
|
||||
|
||||
|
||||
start = string;
|
||||
ifsspc = 0;
|
||||
nulonly = 0;
|
||||
if (ifslastp != NULL) {
|
||||
ifsp = &ifsfirst;
|
||||
do {
|
||||
p = string + ifsp->begoff;
|
||||
nulonly = ifsp->nulonly;
|
||||
ifs = nulonly ? nullstr :
|
||||
( ifsset() ? ifsval() : " \t\n" );
|
||||
ifsspc = 0;
|
||||
ifs = ifsp->nulonly? nullstr : ifsval();
|
||||
ifsspc = strchr(ifs, ' ') != NULL;
|
||||
while (p < string + ifsp->endoff) {
|
||||
q = p;
|
||||
if (*p == CTLESC)
|
||||
p++;
|
||||
if (strchr(ifs, *p)) {
|
||||
if (!nulonly)
|
||||
ifsspc = (strchr(" \t\n", *p) != NULL);
|
||||
/* Ignore IFS whitespace at start */
|
||||
if (q == start && ifsspc) {
|
||||
p++;
|
||||
start = p;
|
||||
continue;
|
||||
if (strchr(ifs, *p++)) {
|
||||
if (q > start || !ifsspc) {
|
||||
*q = '\0';
|
||||
sp = (struct strlist *)stalloc(sizeof *sp);
|
||||
sp->text = start;
|
||||
*arglist->lastp = sp;
|
||||
arglist->lastp = &sp->next;
|
||||
}
|
||||
*q = '\0';
|
||||
sp = (struct strlist *)stalloc(sizeof *sp);
|
||||
sp->text = start;
|
||||
*arglist->lastp = sp;
|
||||
arglist->lastp = &sp->next;
|
||||
p++;
|
||||
if (!nulonly) {
|
||||
if (ifsspc) {
|
||||
for (;;) {
|
||||
if (p >= string + ifsp->endoff) {
|
||||
if (p >= string + ifsp->endoff)
|
||||
break;
|
||||
}
|
||||
q = p;
|
||||
if (*p == CTLESC)
|
||||
p++;
|
||||
if (strchr(ifs, *p) == NULL ) {
|
||||
if (strchr(ifs, *p++) == NULL) {
|
||||
p = q;
|
||||
break;
|
||||
} else if (strchr(" \t\n",*p) == NULL) {
|
||||
if (ifsspc) {
|
||||
p++;
|
||||
ifsspc = 0;
|
||||
} else {
|
||||
p = q;
|
||||
break;
|
||||
}
|
||||
} else
|
||||
p++;
|
||||
}
|
||||
}
|
||||
}
|
||||
start = p;
|
||||
} else
|
||||
p++;
|
||||
}
|
||||
}
|
||||
} while ((ifsp = ifsp->next) != NULL);
|
||||
if (*start || (!ifsspc && start > string &&
|
||||
(nulonly || 1))) {
|
||||
if (*start || (!ifsspc && start > string)) {
|
||||
sp = (struct strlist *)stalloc(sizeof *sp);
|
||||
sp->text = start;
|
||||
*arglist->lastp = sp;
|
||||
@@ -1125,8 +1035,6 @@ expmeta(enddir, name)
|
||||
if (*q == '!' || *q == '^')
|
||||
q++;
|
||||
for (;;) {
|
||||
while (*q == CTLQUOTEMARK)
|
||||
q++;
|
||||
if (*q == CTLESC)
|
||||
q++;
|
||||
if (*q == '/' || *q == '\0')
|
||||
@@ -1140,8 +1048,6 @@ expmeta(enddir, name)
|
||||
metaflag = 1;
|
||||
} else if (*p == '\0')
|
||||
break;
|
||||
else if (*p == CTLQUOTEMARK)
|
||||
continue;
|
||||
else if (*p == CTLESC)
|
||||
p++;
|
||||
if (*p == '/') {
|
||||
@@ -1154,8 +1060,6 @@ expmeta(enddir, name)
|
||||
if (enddir != expdir)
|
||||
metaflag++;
|
||||
for (p = name ; ; p++) {
|
||||
if (*p == CTLQUOTEMARK)
|
||||
continue;
|
||||
if (*p == CTLESC)
|
||||
p++;
|
||||
*enddir++ = *p;
|
||||
@@ -1170,8 +1074,6 @@ expmeta(enddir, name)
|
||||
if (start != name) {
|
||||
p = name;
|
||||
while (p < start) {
|
||||
while (*p == CTLQUOTEMARK)
|
||||
p++;
|
||||
if (*p == CTLESC)
|
||||
p++;
|
||||
*enddir++ = *p++;
|
||||
@@ -1196,12 +1098,7 @@ expmeta(enddir, name)
|
||||
*endname++ = '\0';
|
||||
}
|
||||
matchdot = 0;
|
||||
p = start;
|
||||
while (*p == CTLQUOTEMARK)
|
||||
p++;
|
||||
if (*p == CTLESC)
|
||||
p++;
|
||||
if (*p == '.')
|
||||
if (start[0] == '.' || (start[0] == CTLESC && start[1] == '.'))
|
||||
matchdot++;
|
||||
while (! int_pending() && (dp = readdir(dirp)) != NULL) {
|
||||
if (dp->d_name[0] == '.' && ! matchdot)
|
||||
@@ -1346,18 +1243,13 @@ pmatch(pattern, string)
|
||||
if (*q++ != *p++)
|
||||
return 0;
|
||||
break;
|
||||
case CTLQUOTEMARK:
|
||||
continue;
|
||||
case '?':
|
||||
if (*q++ == '\0')
|
||||
return 0;
|
||||
break;
|
||||
case '*':
|
||||
c = *p;
|
||||
while (c == CTLQUOTEMARK || c == '*')
|
||||
c = *++p;
|
||||
if (c != CTLESC && c != CTLQUOTEMARK &&
|
||||
c != '?' && c != '*' && c != '[') {
|
||||
if (c != CTLESC && c != '?' && c != '*' && c != '[') {
|
||||
while (*q != c) {
|
||||
if (*q == '\0')
|
||||
return 0;
|
||||
@@ -1378,8 +1270,6 @@ pmatch(pattern, string)
|
||||
if (*endp == '!' || *endp == '^')
|
||||
endp++;
|
||||
for (;;) {
|
||||
while (*endp == CTLQUOTEMARK)
|
||||
endp++;
|
||||
if (*endp == '\0')
|
||||
goto dft; /* no matching ] */
|
||||
if (*endp == CTLESC)
|
||||
@@ -1398,14 +1288,10 @@ pmatch(pattern, string)
|
||||
return 0;
|
||||
c = *p++;
|
||||
do {
|
||||
if (c == CTLQUOTEMARK)
|
||||
continue;
|
||||
if (c == CTLESC)
|
||||
c = *p++;
|
||||
if (*p == '-' && p[1] != ']') {
|
||||
p++;
|
||||
while (*p == CTLQUOTEMARK)
|
||||
p++;
|
||||
if (*p == CTLESC)
|
||||
p++;
|
||||
if ( collate_range_cmp(chr, c) >= 0
|
||||
@@ -1443,20 +1329,16 @@ breakloop:
|
||||
void
|
||||
rmescapes(str)
|
||||
char *str;
|
||||
{
|
||||
{
|
||||
char *p, *q;
|
||||
|
||||
p = str;
|
||||
while (*p != CTLESC && *p != CTLQUOTEMARK) {
|
||||
while (*p != CTLESC) {
|
||||
if (*p++ == '\0')
|
||||
return;
|
||||
}
|
||||
q = p;
|
||||
while (*p) {
|
||||
if (*p == CTLQUOTEMARK) {
|
||||
p++;
|
||||
continue;
|
||||
}
|
||||
if (*p == CTLESC)
|
||||
p++;
|
||||
*q++ = *p++;
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)expand.h 8.2 (Berkeley) 5/4/95
|
||||
* $Id: expand.h,v 1.7 1998/09/13 19:24:57 tegge Exp $
|
||||
* $Id: expand.h,v 1.2 1994/09/24 02:57:35 davidg Exp $
|
||||
*/
|
||||
|
||||
struct strlist {
|
||||
|
||||
+3
-5
@@ -32,14 +32,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: histedit.c,v 1.6 1996/09/03 13:35:09 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)histedit.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: histedit.c,v 1.12 1998/05/18 06:43:42 charnier Exp $";
|
||||
static char const sccsid[] = "@(#)histedit.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)init.h 8.2 (Berkeley) 5/4/95
|
||||
* $Id: init.h,v 1.5 1997/02/22 13:58:27 peter Exp $
|
||||
* $Id: init.h,v 1.2 1994/09/24 02:57:37 davidg Exp $
|
||||
*/
|
||||
|
||||
void init __P((void));
|
||||
|
||||
+3
-5
@@ -32,14 +32,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: input.c,v 1.6 1996/09/03 14:15:50 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)input.c 8.3 (Berkeley) 6/9/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: input.c,v 1.11 1998/05/18 06:43:45 charnier Exp $";
|
||||
static char const sccsid[] = "@(#)input.c 8.3 (Berkeley) 6/9/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <stdio.h> /* defines BUFSIZ */
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)input.h 8.2 (Berkeley) 5/4/95
|
||||
* $Id: input.h,v 1.6 1997/02/22 13:58:28 peter Exp $
|
||||
* $Id: input.h,v 1.3 1996/09/01 10:20:21 peter Exp $
|
||||
*/
|
||||
|
||||
/* PEOF (the end of file marker) is defined in syntax.h */
|
||||
|
||||
+14
-39
@@ -32,14 +32,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: jobs.c,v 1.8.2.3 1997/08/25 09:10:00 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)jobs.c 8.5 (Berkeley) 5/4/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: jobs.c,v 1.23 1998/09/08 13:16:52 cracauer Exp $";
|
||||
static char const sccsid[] = "@(#)jobs.c 8.5 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <fcntl.h>
|
||||
@@ -87,9 +85,6 @@ MKINIT pid_t backgndpid = -1; /* pid of last background process */
|
||||
int initialpgrp; /* pgrp of shell on invocation */
|
||||
int curjob; /* current job */
|
||||
#endif
|
||||
int in_waitcmd = 0; /* are we in waitcmd()? */
|
||||
int in_dowait = 0; /* are we in dowait()? */
|
||||
volatile sig_atomic_t breakwaitcmd = 0; /* should wait be terminated? */
|
||||
|
||||
#if JOBS
|
||||
STATIC void restartjob __P((struct job *));
|
||||
@@ -388,14 +383,7 @@ waitcmd(argc, argv)
|
||||
} else {
|
||||
job = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Loop until a process is terminated or stopped, or a SIGINT is
|
||||
* received.
|
||||
*/
|
||||
|
||||
in_waitcmd++;
|
||||
do {
|
||||
for (;;) { /* loop until process terminated or stopped */
|
||||
if (job != NULL) {
|
||||
if (job->state) {
|
||||
status = job->ps[job->nprocs - 1].status;
|
||||
@@ -409,23 +397,19 @@ waitcmd(argc, argv)
|
||||
retval = WTERMSIG(status) + 128;
|
||||
if (! iflag)
|
||||
freejob(job);
|
||||
in_waitcmd--;
|
||||
return retval;
|
||||
}
|
||||
} else {
|
||||
for (jp = jobtab ; ; jp++) {
|
||||
if (jp >= jobtab + njobs) { /* no running procs */
|
||||
in_waitcmd--;
|
||||
return 0;
|
||||
}
|
||||
if (jp->used && jp->state == 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while (dowait(1, (struct job *)NULL) != -1);
|
||||
in_waitcmd--;
|
||||
|
||||
return 0;
|
||||
dowait(1, (struct job *)NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -713,9 +697,9 @@ waitforjob(jp)
|
||||
|
||||
INTOFF;
|
||||
TRACE(("waitforjob(%%%d) called\n", jp - jobtab + 1));
|
||||
while (jp->state == 0)
|
||||
if (dowait(1, jp) == -1)
|
||||
dotrap();
|
||||
while (jp->state == 0) {
|
||||
dowait(1, jp);
|
||||
}
|
||||
#if JOBS
|
||||
if (jp->jobctl) {
|
||||
#ifdef OLD_TTY_DRIVER
|
||||
@@ -741,12 +725,9 @@ waitforjob(jp)
|
||||
st = WTERMSIG(status) + 128;
|
||||
if (! JOBS || jp->state == JOBDONE)
|
||||
freejob(jp);
|
||||
if (int_pending()) {
|
||||
if (WIFSIGNALED(status) && WTERMSIG(status) == SIGINT)
|
||||
kill(getpid(), SIGINT);
|
||||
else
|
||||
CLEAR_PENDING_INT;
|
||||
}
|
||||
CLEAR_PENDING_INT;
|
||||
if (WIFSIGNALED(status) && WTERMSIG(status) == SIGINT)
|
||||
kill(getpid(), SIGINT);
|
||||
INTON;
|
||||
return st;
|
||||
}
|
||||
@@ -772,17 +753,11 @@ dowait(block, job)
|
||||
int core;
|
||||
int sig;
|
||||
|
||||
in_dowait++;
|
||||
TRACE(("dowait(%d) called\n", block));
|
||||
do {
|
||||
pid = waitproc(block, &status);
|
||||
TRACE(("wait returns %d, status=%d\n", pid, status));
|
||||
} while (pid == -1 && errno == EINTR && breakwaitcmd == 0);
|
||||
in_dowait--;
|
||||
if (breakwaitcmd != 0) {
|
||||
breakwaitcmd = 0;
|
||||
return -1;
|
||||
}
|
||||
} while (pid == -1 && errno == EINTR);
|
||||
if (pid <= 0)
|
||||
return pid;
|
||||
INTOFF;
|
||||
@@ -890,7 +865,7 @@ dowait(block, job)
|
||||
*/
|
||||
|
||||
#ifdef SYSV
|
||||
STATIC sig_atomic_t gotsigchild;
|
||||
STATIC int gotsigchild;
|
||||
|
||||
STATIC int onsigchild() {
|
||||
gotsigchild = 1;
|
||||
|
||||
+1
-5
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)jobs.h 8.2 (Berkeley) 5/4/95
|
||||
* $Id: jobs.h,v 1.10 1998/09/10 22:09:11 cracauer Exp $
|
||||
* $Id: jobs.h,v 1.3 1996/09/01 10:20:27 peter Exp $
|
||||
*/
|
||||
|
||||
/* Mode argument to forkshell. Don't change FORK_FG or FORK_BG. */
|
||||
@@ -42,7 +42,6 @@
|
||||
#define FORK_BG 1
|
||||
#define FORK_NOJOB 2
|
||||
|
||||
#include <signal.h> /* for sig_atomic_t */
|
||||
|
||||
/*
|
||||
* A job structure contains information about a job. A job is either a
|
||||
@@ -78,9 +77,6 @@ struct job {
|
||||
|
||||
extern pid_t backgndpid; /* pid of last background process */
|
||||
extern int job_warning; /* user was warned about stopped jobs */
|
||||
extern int in_waitcmd; /* are we in waitcmd()? */
|
||||
extern int in_dowait; /* are we in dowait()? */
|
||||
extern volatile sig_atomic_t breakwaitcmd; /* break wait to process traps? */
|
||||
|
||||
void setjobctl __P((int));
|
||||
int fgcmd __P((int, char **));
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)machdep.h 8.2 (Berkeley) 5/4/95
|
||||
* $Id: machdep.h,v 1.5 1997/02/22 13:58:30 peter Exp $
|
||||
* $Id: machdep.h,v 1.2 1994/09/24 02:57:43 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+3
-5
@@ -32,14 +32,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: mail.c,v 1.3 1996/09/01 10:20:35 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)mail.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: mail.c,v 1.8 1998/05/18 06:43:50 charnier Exp $";
|
||||
static char const sccsid[] = "@(#)mail.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)mail.h 8.2 (Berkeley) 5/4/95
|
||||
* $Id: mail.h,v 1.5 1997/02/22 13:58:33 peter Exp $
|
||||
* $Id: mail.h,v 1.2 1994/09/24 02:57:45 davidg Exp $
|
||||
*/
|
||||
|
||||
void chkmail __P((int));
|
||||
+3
-5
@@ -32,6 +32,8 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: main.c,v 1.9.2.1 1997/08/03 18:44:27 steve Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -41,11 +43,7 @@ static char const copyright[] =
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/28/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: main.c,v 1.15 1998/05/18 06:43:52 charnier Exp $";
|
||||
static char const sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/28/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)main.h 8.2 (Berkeley) 5/4/95
|
||||
* $Id: main.h,v 1.5 1997/02/22 13:58:34 peter Exp $
|
||||
* $Id: main.h,v 1.2 1994/09/24 02:57:49 davidg Exp $
|
||||
*/
|
||||
|
||||
extern int rootpid; /* pid of main shell */
|
||||
|
||||
+3
-6
@@ -32,14 +32,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: memalloc.c,v 1.4 1996/09/03 14:15:53 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)memalloc.c 8.3 (Berkeley) 5/4/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: memalloc.c,v 1.12 1998/09/13 19:24:57 tegge Exp $";
|
||||
static char const sccsid[] = "@(#)memalloc.c 8.3 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "shell.h"
|
||||
@@ -48,7 +46,6 @@ static const char rcsid[] =
|
||||
#include "error.h"
|
||||
#include "machdep.h"
|
||||
#include "mystring.h"
|
||||
#include "expand.h"
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)memalloc.h 8.2 (Berkeley) 5/4/95
|
||||
* $Id: memalloc.h,v 1.5 1997/02/22 13:58:35 peter Exp $
|
||||
* $Id: memalloc.h,v 1.2 1994/09/24 02:57:51 davidg Exp $
|
||||
*/
|
||||
|
||||
struct stackmark {
|
||||
|
||||
+3
-6
@@ -32,14 +32,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: miscbltin.c,v 1.8.2.1 1997/08/25 09:10:10 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)miscbltin.c 8.4 (Berkeley) 5/4/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: miscbltin.c,v 1.17 1998/08/25 09:33:34 cracauer Exp $";
|
||||
static char const sccsid[] = "@(#)miscbltin.c 8.4 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@@ -54,7 +52,6 @@ static const char rcsid[] =
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <termios.h>
|
||||
|
||||
#include "shell.h"
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
# SUCH DAMAGE.
|
||||
#
|
||||
# @(#)mkbuiltins 8.2 (Berkeley) 5/4/95
|
||||
# $Id: mkbuiltins,v 1.7 1997/02/22 13:58:36 peter Exp $
|
||||
# $Id: mkbuiltins,v 1.4 1996/06/24 04:22:22 jkh Exp $
|
||||
|
||||
temp=/tmp/ka$$
|
||||
havejobs=0
|
||||
|
||||
+3
-5
@@ -32,6 +32,8 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: mkinit.c,v 1.6 1996/09/01 10:20:50 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -41,11 +43,7 @@ static char const copyright[] =
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)mkinit.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: mkinit.c,v 1.12 1998/05/18 06:44:00 charnier Exp $";
|
||||
static char const sccsid[] = "@(#)mkinit.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
|
||||
+3
-5
@@ -32,6 +32,8 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: mknodes.c,v 1.4 1996/09/03 13:35:11 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -41,11 +43,7 @@ static char const copyright[] =
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)mknodes.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: mknodes.c,v 1.9 1998/05/18 06:44:01 charnier Exp $";
|
||||
static char const sccsid[] = "@(#)mknodes.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
|
||||
+3
-6
@@ -32,6 +32,8 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: mksyntax.c,v 1.6 1996/09/01 10:20:56 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -41,11 +43,7 @@ static char const copyright[] =
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)mksyntax.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: mksyntax.c,v 1.12 1998/09/06 21:13:09 tegge Exp $";
|
||||
static char const sccsid[] = "@(#)mksyntax.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@@ -293,7 +291,6 @@ init()
|
||||
syntax[base + CTLBACKQ + CTLQUOTE] = "CCTL";
|
||||
syntax[base + CTLARI] = "CCTL";
|
||||
syntax[base + CTLENDARI] = "CCTL";
|
||||
syntax[base + CTLQUOTEMARK] = "CCTL";
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
# SUCH DAMAGE.
|
||||
#
|
||||
# @(#)mktokens 8.1 (Berkeley) 5/31/93
|
||||
# $Id: mktokens,v 1.5 1997/02/22 13:58:37 peter Exp $
|
||||
# $Id: mktokens,v 1.2 1994/09/24 02:57:58 davidg Exp $
|
||||
|
||||
# The following is a list of tokens. The second column is nonzero if the
|
||||
# token marks the end of a list. The third column is the name to print in
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)myhistedit.h 8.2 (Berkeley) 5/4/95
|
||||
* $Id: myhistedit.h,v 1.6 1997/02/22 13:58:38 peter Exp $
|
||||
* $Id: myhistedit.h,v 1.3 1996/09/01 10:21:00 peter Exp $
|
||||
*/
|
||||
|
||||
#include <histedit.h>
|
||||
|
||||
+3
-5
@@ -32,14 +32,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: mystring.c,v 1.4 1996/09/03 14:15:55 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)mystring.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: mystring.c,v 1.9 1998/05/18 06:44:06 charnier Exp $";
|
||||
static char const sccsid[] = "@(#)mystring.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)mystring.h 8.2 (Berkeley) 5/4/95
|
||||
* $Id: mystring.h,v 1.5 1997/02/22 13:58:39 peter Exp $
|
||||
* $Id: mystring.h,v 1.2 1994/09/24 02:58:00 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nodes.c.pat 8.2 (Berkeley) 5/4/95
|
||||
* $Id: nodes.c.pat,v 1.6 1997/04/28 03:14:04 steve Exp $
|
||||
* $Id: nodes.c.pat,v 1.3 1996/09/01 10:21:08 peter Exp $
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
# SUCH DAMAGE.
|
||||
#
|
||||
# @(#)nodetypes 8.2 (Berkeley) 5/4/95
|
||||
# $Id: nodetypes,v 1.5 1997/02/22 13:58:39 peter Exp $
|
||||
# $Id: nodetypes,v 1.2 1994/09/24 02:58:03 davidg Exp $
|
||||
|
||||
# This file describes the nodes used in parse trees. Unindented lines
|
||||
# contain a node type followed by a structure tag. Subsequent indented
|
||||
|
||||
+3
-5
@@ -32,14 +32,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: options.c,v 1.8.2.1 1996/12/21 21:10:25 joerg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: options.c,v 1.14 1998/05/18 06:44:08 charnier Exp $";
|
||||
static char const sccsid[] = "@(#)options.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)options.h 8.2 (Berkeley) 5/4/95
|
||||
* $Id: options.h,v 1.7 1997/02/22 13:58:40 peter Exp $
|
||||
* $Id: options.h,v 1.4 1996/10/29 03:12:49 steve Exp $
|
||||
*/
|
||||
|
||||
struct shparam {
|
||||
|
||||
+3
-5
@@ -32,14 +32,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: output.c,v 1.4 1996/09/03 14:15:56 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)output.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: output.c,v 1.9 1998/05/18 06:44:10 charnier Exp $";
|
||||
static char const sccsid[] = "@(#)output.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)output.h 8.2 (Berkeley) 5/4/95
|
||||
* $Id: output.h,v 1.7 1997/04/28 03:06:38 steve Exp $
|
||||
* $Id: output.h,v 1.3 1996/09/01 10:21:29 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef OUTPUT_INCL
|
||||
|
||||
+7
-28
@@ -32,14 +32,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: parser.c,v 1.16 1996/09/10 02:42:33 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)parser.c 8.7 (Berkeley) 5/16/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: parser.c,v 1.24 1998/09/13 19:24:57 tegge Exp $";
|
||||
static char const sccsid[] = "@(#)parser.c 8.7 (Berkeley) 5/16/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -942,36 +940,27 @@ readtoken1(firstc, syntax, eofmark, striptabs)
|
||||
USTPUTC('\\', out);
|
||||
if (SQSYNTAX[c] == CCTL)
|
||||
USTPUTC(CTLESC, out);
|
||||
else if (eofmark == NULL)
|
||||
USTPUTC(CTLQUOTEMARK, out);
|
||||
USTPUTC(c, out);
|
||||
quotef++;
|
||||
}
|
||||
break;
|
||||
case CSQUOTE:
|
||||
if (eofmark == NULL)
|
||||
USTPUTC(CTLQUOTEMARK, out);
|
||||
syntax = SQSYNTAX;
|
||||
break;
|
||||
case CDQUOTE:
|
||||
if (eofmark == NULL)
|
||||
USTPUTC(CTLQUOTEMARK, out);
|
||||
syntax = DQSYNTAX;
|
||||
dblquote = 1;
|
||||
break;
|
||||
case CENDQUOTE:
|
||||
if (eofmark != NULL && arinest == 0 &&
|
||||
varnest == 0) {
|
||||
if (eofmark) {
|
||||
USTPUTC(c, out);
|
||||
} else {
|
||||
if (arinest) {
|
||||
if (arinest)
|
||||
syntax = ARISYNTAX;
|
||||
dblquote = 0;
|
||||
} else if (eofmark == NULL) {
|
||||
else
|
||||
syntax = BASESYNTAX;
|
||||
dblquote = 0;
|
||||
}
|
||||
quotef++;
|
||||
dblquote = 0;
|
||||
}
|
||||
break;
|
||||
case CVAR: /* '$' */
|
||||
@@ -998,10 +987,6 @@ readtoken1(firstc, syntax, eofmark, striptabs)
|
||||
if (--arinest == 0) {
|
||||
USTPUTC(CTLENDARI, out);
|
||||
syntax = prevsyntax;
|
||||
if (syntax == DQSYNTAX)
|
||||
dblquote = 1;
|
||||
else
|
||||
dblquote = 0;
|
||||
} else
|
||||
USTPUTC(')', out);
|
||||
} else {
|
||||
@@ -1414,10 +1399,6 @@ parsearith: {
|
||||
prevsyntax = syntax;
|
||||
syntax = ARISYNTAX;
|
||||
USTPUTC(CTLARI, out);
|
||||
if (dblquote)
|
||||
USTPUTC('"',out);
|
||||
else
|
||||
USTPUTC(' ',out);
|
||||
} else {
|
||||
/*
|
||||
* we collapse embedded arithmetic expansion to
|
||||
@@ -1453,8 +1434,6 @@ noexpand(text)
|
||||
|
||||
p = text;
|
||||
while ((c = *p++) != '\0') {
|
||||
if ( c == CTLQUOTEMARK)
|
||||
continue;
|
||||
if (c == CTLESC)
|
||||
p++;
|
||||
else if (BASESYNTAX[c] == CCTL)
|
||||
|
||||
+1
-2
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)parser.h 8.3 (Berkeley) 5/4/95
|
||||
* $Id: parser.h,v 1.7 1998/09/06 21:13:09 tegge Exp $
|
||||
* $Id: parser.h,v 1.3 1996/09/01 10:21:34 peter Exp $
|
||||
*/
|
||||
|
||||
/* control characters in argument strings */
|
||||
@@ -46,7 +46,6 @@
|
||||
/* CTLBACKQ | CTLQUOTE == '\205' */
|
||||
#define CTLARI '\206'
|
||||
#define CTLENDARI '\207'
|
||||
#define CTLQUOTEMARK '\210'
|
||||
|
||||
/* variable substitution byte (follows CTLVAR) */
|
||||
#define VSTYPE 0x0f /* type of variable substitution */
|
||||
|
||||
+3
-5
@@ -32,14 +32,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: redir.c,v 1.5 1996/09/01 10:21:36 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)redir.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: redir.c,v 1.10 1998/05/18 06:44:14 charnier Exp $";
|
||||
static char const sccsid[] = "@(#)redir.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)redir.h 8.2 (Berkeley) 5/4/95
|
||||
* $Id: redir.h,v 1.6 1997/02/22 13:58:43 peter Exp $
|
||||
* $Id: redir.h,v 1.3 1996/09/01 10:21:37 peter Exp $
|
||||
*/
|
||||
|
||||
/* flags passed to redirect */
|
||||
|
||||
+2
-7
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
|
||||
.\" $Id: sh.1,v 1.21 1998/07/30 04:47:56 jkoshy Exp $
|
||||
.\" $Id: sh.1,v 1.9.2.8 1998/02/15 11:32:26 jkh Exp $
|
||||
.\"
|
||||
.Dd May 5, 1995
|
||||
.Dt SH 1
|
||||
@@ -141,12 +141,7 @@ single letter option in the descriptions below. Specifying a dash
|
||||
.Dq -
|
||||
enables the option, while using a plus
|
||||
.Dq +
|
||||
disables the option. A
|
||||
.Dq --
|
||||
or plain
|
||||
.Dq -
|
||||
will stop option processing and will force the remaining
|
||||
words on the command line to be treated as arguments.
|
||||
disables the option.
|
||||
.Bl -tag -width Ds
|
||||
.It Fl a Li allexport
|
||||
Export all variables assigned to.
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)shell.h 8.2 (Berkeley) 5/4/95
|
||||
* $Id: shell.h,v 1.10 1997/02/22 13:58:45 peter Exp $
|
||||
* $Id: shell.h,v 1.6 1996/10/31 07:15:57 ache Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
+3
-5
@@ -32,14 +32,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: show.c,v 1.4 1996/09/03 14:16:00 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)show.c 8.3 (Berkeley) 5/4/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: show.c,v 1.9 1998/05/18 06:44:19 charnier Exp $";
|
||||
static char const sccsid[] = "@(#)show.c 8.3 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)show.h 1.1 (Berkeley) 5/4/95
|
||||
* $Id: show.h,v 1.6 1997/04/28 03:17:51 steve Exp $
|
||||
* $Id: show.h,v 1.2 1996/09/01 10:21:45 peter Exp $
|
||||
*/
|
||||
|
||||
void showtree __P((union node *));
|
||||
|
||||
+14
-33
@@ -32,14 +32,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: trap.c,v 1.4.2.1 1997/08/25 09:10:46 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)trap.c 8.5 (Berkeley) 6/5/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: trap.c,v 1.17 1998/09/10 22:09:11 cracauer Exp $";
|
||||
static char const sccsid[] = "@(#)trap.c 8.5 (Berkeley) 6/5/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <signal.h>
|
||||
@@ -75,11 +73,9 @@ static const char rcsid[] =
|
||||
|
||||
|
||||
MKINIT char sigmode[NSIG]; /* current value of signal */
|
||||
int pendingsigs; /* indicates some signal received */
|
||||
int in_dotrap; /* do we execute in a trap handler? */
|
||||
static char *volatile trap[NSIG]; /* trap handler commands */
|
||||
static volatile sig_atomic_t gotsig[NSIG];
|
||||
/* indicates specified signal received */
|
||||
int pendingsigs; /* indicates some signal received */
|
||||
static char *trap[NSIG]; /* trap handler commands */
|
||||
static char gotsig[NSIG]; /* indicates specified signal received */
|
||||
static int ignore_sigchld; /* Used while handling SIGCHLD traps. */
|
||||
|
||||
static int getsigaction __P((int, sig_t *));
|
||||
@@ -190,7 +186,7 @@ trapcmd(argc, argv)
|
||||
void
|
||||
clear_traps()
|
||||
{
|
||||
char *volatile *tp;
|
||||
char **tp;
|
||||
|
||||
for (tp = trap ; tp <= &trap[NSIG - 1] ; tp++) {
|
||||
if (*tp && **tp) { /* trap not NULL or SIG_IGN */
|
||||
@@ -223,10 +219,11 @@ setsignal(signo)
|
||||
action = S_CATCH;
|
||||
else
|
||||
action = S_IGN;
|
||||
if (action == S_DFL) {
|
||||
if (rootshell && action == S_DFL) {
|
||||
switch (signo) {
|
||||
case SIGINT:
|
||||
action = S_CATCH;
|
||||
if (iflag)
|
||||
action = S_CATCH;
|
||||
break;
|
||||
case SIGQUIT:
|
||||
#ifdef DEBUG
|
||||
@@ -237,16 +234,15 @@ setsignal(signo)
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
action = S_CATCH;
|
||||
break;
|
||||
/* FALLTHROUGH */
|
||||
case SIGTERM:
|
||||
if (rootshell && iflag)
|
||||
if (iflag)
|
||||
action = S_IGN;
|
||||
break;
|
||||
#if JOBS
|
||||
case SIGTSTP:
|
||||
case SIGTTOU:
|
||||
if (rootshell && mflag)
|
||||
if (mflag)
|
||||
action = S_IGN;
|
||||
break;
|
||||
#endif
|
||||
@@ -355,22 +351,9 @@ onsig(signo)
|
||||
onint();
|
||||
return;
|
||||
}
|
||||
|
||||
if (signo != SIGCHLD || !ignore_sigchld)
|
||||
gotsig[signo] = 1;
|
||||
pendingsigs++;
|
||||
|
||||
/* If we are currently in a wait builtin, prepare to break it */
|
||||
if ((signo == SIGINT || signo == SIGQUIT) && in_waitcmd != 0)
|
||||
breakwaitcmd = 1;
|
||||
/*
|
||||
* If a trap is set, not ignored and not the null command, we need
|
||||
* to make sure traps are executed even when a child blocks signals.
|
||||
*/
|
||||
if (trap[signo] != NULL &&
|
||||
! trap[signo][0] == '\0' &&
|
||||
! (trap[signo][0] == ':' && trap[signo][1] == '\0'))
|
||||
breakwaitcmd = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -384,7 +367,6 @@ dotrap()
|
||||
int i;
|
||||
int savestatus;
|
||||
|
||||
in_dotrap++;
|
||||
for (;;) {
|
||||
for (i = 1; i < NSIG; i++) {
|
||||
if (gotsig[i]) {
|
||||
@@ -408,7 +390,6 @@ dotrap()
|
||||
if (i >= NSIG)
|
||||
break;
|
||||
}
|
||||
in_dotrap--;
|
||||
pendingsigs = 0;
|
||||
}
|
||||
|
||||
@@ -420,7 +401,7 @@ void
|
||||
setinteractive(on)
|
||||
int on;
|
||||
{
|
||||
static int is_interactive = -1;
|
||||
static int is_interactive = 0;
|
||||
|
||||
if (on == is_interactive)
|
||||
return;
|
||||
|
||||
+1
-2
@@ -34,11 +34,10 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)trap.h 8.3 (Berkeley) 6/5/95
|
||||
* $Id: trap.h,v 1.8 1998/08/24 10:20:37 cracauer Exp $
|
||||
* $Id: trap.h,v 1.3.2.1 1997/08/25 09:10:48 jkh Exp $
|
||||
*/
|
||||
|
||||
extern int pendingsigs;
|
||||
extern int in_dotrap;
|
||||
|
||||
int trapcmd __P((int, char **));
|
||||
void clear_traps __P((void));
|
||||
|
||||
+3
-5
@@ -32,14 +32,12 @@
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: var.c,v 1.6 1996/09/01 10:21:52 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 5/4/95";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: var.c,v 1.12 1998/05/18 06:44:24 charnier Exp $";
|
||||
static char const sccsid[] = "@(#)var.c 8.3 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
+1
-2
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)var.h 8.2 (Berkeley) 5/4/95
|
||||
* $Id: var.h,v 1.7 1998/09/06 21:13:09 tegge Exp $
|
||||
* $Id: var.h,v 1.3 1996/09/01 10:21:54 peter Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -94,7 +94,6 @@ extern struct var vhistsize;
|
||||
*/
|
||||
|
||||
#define ifsval() (vifs.text + 4)
|
||||
#define ifsset() ((vifs.flags & VUNSET) == 0)
|
||||
#define mailval() (vmail.text + 5)
|
||||
#define mpathval() (vmpath.text + 9)
|
||||
#define pathval() (vpath.text + 5)
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: operators.c,v 1.3.8.1 1997/08/25 09:26:32 jkh Exp $
|
||||
* $Id: operators.c,v 1.3 1994/09/24 02:59:12 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -64,7 +64,6 @@ const char *const unary_op[] = {
|
||||
"-w",
|
||||
"-x",
|
||||
"-z",
|
||||
"-S",
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -113,7 +112,6 @@ const char op_priority[] = {
|
||||
12,
|
||||
12,
|
||||
12,
|
||||
12,
|
||||
1,
|
||||
1,
|
||||
2,
|
||||
@@ -147,7 +145,6 @@ const char op_argflag[] = {
|
||||
OP_FILE,
|
||||
OP_FILE,
|
||||
OP_STRING,
|
||||
OP_FILE,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
|
||||
+14
-15
@@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)operators.h 8.3 (Berkeley) 4/2/94
|
||||
* $Id: operators.h,v 1.3 1994/09/24 02:59:13 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define NOT 0
|
||||
@@ -52,21 +52,20 @@
|
||||
#define ISWRITE 15
|
||||
#define ISEXEC 16
|
||||
#define NULSTR 17
|
||||
#define ISSOCK 18
|
||||
|
||||
#define FIRST_BINARY_OP 19
|
||||
#define OR1 FIRST_BINARY_OP
|
||||
#define OR2 (FIRST_BINARY_OP + 1)
|
||||
#define AND1 (FIRST_BINARY_OP + 2)
|
||||
#define AND2 (FIRST_BINARY_OP + 3)
|
||||
#define STREQ (FIRST_BINARY_OP + 4)
|
||||
#define STRNE (FIRST_BINARY_OP + 5)
|
||||
#define EQ (FIRST_BINARY_OP + 6)
|
||||
#define NE (FIRST_BINARY_OP + 7)
|
||||
#define GT (FIRST_BINARY_OP + 8)
|
||||
#define LT (FIRST_BINARY_OP + 9)
|
||||
#define LE (FIRST_BINARY_OP + 10)
|
||||
#define GE (FIRST_BINARY_OP + 11)
|
||||
#define FIRST_BINARY_OP 18
|
||||
#define OR1 18
|
||||
#define OR2 19
|
||||
#define AND1 20
|
||||
#define AND2 21
|
||||
#define STREQ 22
|
||||
#define STRNE 23
|
||||
#define EQ 24
|
||||
#define NE 25
|
||||
#define GT 26
|
||||
#define LT 27
|
||||
#define LE 28
|
||||
#define GE 29
|
||||
|
||||
|
||||
#define OP_INT 1 /* arguments to operator are integer */
|
||||
|
||||
+1
-5
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)test.1 8.1 (Berkeley) 5/31/93
|
||||
.\" $Id: test.1,v 1.2.8.2 1998/07/16 09:35:53 jkh Exp $
|
||||
.\" $Id: test.1,v 1.2.8.1 1997/06/02 06:40:08 charnier Exp $
|
||||
.\"
|
||||
.Dd May 31, 1993
|
||||
.Dt TEST 1
|
||||
@@ -99,10 +99,6 @@ True if
|
||||
.Ar file
|
||||
is a named pipe
|
||||
.Po Tn FIFO Pc .
|
||||
.It Fl S Ar file
|
||||
True if
|
||||
.Ar file
|
||||
is a socket.
|
||||
.It Fl r Ar file
|
||||
True if
|
||||
.Ar file
|
||||
|
||||
+1
-4
@@ -33,7 +33,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: test.c,v 1.13.2.3 1998/02/15 13:32:21 jkh Exp $
|
||||
* $Id: test.c,v 1.13.2.2 1997/08/25 09:26:35 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -392,9 +392,6 @@ permission: if (fs->stat.st_uid == geteuid())
|
||||
case ISFIFO:
|
||||
i = S_IFIFO;
|
||||
goto filetype;
|
||||
case ISSOCK:
|
||||
i = S_IFSOCK;
|
||||
goto filetype;
|
||||
filetype: if ((fs->stat.st_mode & S_IFMT) == i && fs->rcode >= 0)
|
||||
true: sp->u.num = 1;
|
||||
else
|
||||
|
||||
@@ -68,7 +68,7 @@ by the domain server.
|
||||
The arguments can be either host names or host numbers. The program
|
||||
first attempts to interpret them as host numbers. If this fails,
|
||||
it will treat them as host names. A host number consists of
|
||||
four decimal numbers separated by dots, e.g. 128.6.4.194
|
||||
first decimal numbers separated by dots, e.g. 128.6.4.194
|
||||
A host name
|
||||
consists of names separated by dots, e.g. topaz.rutgers.edu.
|
||||
Unless the name ends in a dot, the local domain
|
||||
@@ -173,7 +173,7 @@ will give a complete download of the zone data for rutgers.edu,
|
||||
in the official master file format. (However the SOA record is
|
||||
listed twice, for arcane reasons.) NOTE: -l is implemented by
|
||||
doing a complete zone transfer and then filtering out the information
|
||||
that you have asked for. This command should be used only if it
|
||||
the you have asked for. This command should be used only if it
|
||||
is absolutely necessary.
|
||||
.SH CUSTOMIZING HOST NAME LOOKUP
|
||||
In general, if the name supplied by the user does not
|
||||
|
||||
@@ -2048,7 +2048,7 @@ A read lock.
|
||||
.TP
|
||||
#cvs.wfl.\fIpid\fP
|
||||
A write lock.
|
||||
.SH "ENVIRONMENT"
|
||||
.SH "ENVIRONMENT VARIABLES"
|
||||
.TP
|
||||
.SM CVSROOT
|
||||
Should contain the full pathname to the root of the
|
||||
@@ -2063,7 +2063,9 @@ supply it on the command line:
|
||||
.` "cvs \-d \fIcvsroot cvs_command\fP\|.\|.\|."
|
||||
You may not need to set
|
||||
.SM CVSROOT
|
||||
if your \fBcvs\fP binary has the right path compiled in.
|
||||
if your \fBcvs\fP binary has the right path compiled in; use
|
||||
.` "cvs \-v"
|
||||
to display all compiled-in paths.
|
||||
.TP
|
||||
.SM CVSREAD
|
||||
If this is set,
|
||||
|
||||
@@ -82,7 +82,7 @@ Boston, MA 02111-1307, USA. */
|
||||
|
||||
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__=2 -D__FreeBSD_cc_version=228000 -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
|
||||
#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__=2 -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
|
||||
|
||||
#define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k}"
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ Boston, MA 02111-1307, USA. */
|
||||
|
||||
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__=2 -D__FreeBSD_cc_version=228000 -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
|
||||
#define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__=2 -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)"
|
||||
|
||||
#define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k}"
|
||||
|
||||
|
||||
@@ -426,9 +426,6 @@
|
||||
. as b1 (``\\*(tNXPG4\\*(aa'')
|
||||
. \}
|
||||
. \}
|
||||
. if "\\*(A\\n(aP"-susv2" \{\
|
||||
. ds b1 \&\\*(tNVersion 2 of the Single UNIX Specification\\*(aa
|
||||
. \}
|
||||
. ie \\n(aC>\\n(aP \{\
|
||||
. nr aP \\n(aP+1
|
||||
. nR
|
||||
|
||||
@@ -73,7 +73,7 @@ k - kill processes; send a signal to a list of processes\n\
|
||||
n or # - change number of processes to display\n", stdout);
|
||||
#ifdef ORDER
|
||||
fputs("\
|
||||
o - specify sort order (pri, size, res, cpu, time)\n", stdout);
|
||||
o - specify sort order (size, res, cpu, time)\n", stdout);
|
||||
#endif
|
||||
fputs("\
|
||||
r - renice a process\n\
|
||||
|
||||
@@ -46,7 +46,6 @@ struct system_info
|
||||
struct process_select
|
||||
{
|
||||
int idle; /* show idle processes */
|
||||
int self; /* show self */
|
||||
int system; /* show system processes */
|
||||
int uid; /* only this uid (unless uid == -1) */
|
||||
char *command; /* only this command (unless == NULL) */
|
||||
|
||||
+2
-12
@@ -9,7 +9,7 @@ top \- display and update information about the top cpu processes
|
||||
.SH SYNOPSIS
|
||||
.B top
|
||||
[
|
||||
.B \-SbiInqut
|
||||
.B \-SbiInqu
|
||||
] [
|
||||
.BI \-d count
|
||||
] [
|
||||
@@ -81,11 +81,6 @@ intelligent terminal.
|
||||
Do not display idle processes.
|
||||
By default, top displays both active and idle processes.
|
||||
.TP
|
||||
.B \-t
|
||||
Do not display the
|
||||
.I top
|
||||
process.
|
||||
.TP
|
||||
.B \-n
|
||||
Use \*(lqnon-interactive\*(rq mode. This is identical to \*(lqbatch\*(rq
|
||||
mode.
|
||||
@@ -158,9 +153,8 @@ can also be specified in the environment variable
|
||||
The options
|
||||
.BR \-I ,
|
||||
.BR \-S ,
|
||||
.BR \-u ,
|
||||
and
|
||||
.B \-t
|
||||
.B \-u
|
||||
are actually toggles. A second specification of any of these options
|
||||
will negate the first. Thus a user who has the environment variable
|
||||
.B TOP
|
||||
@@ -240,10 +234,6 @@ command.
|
||||
(or
|
||||
.BR I)
|
||||
Toggle the display of idle processes.
|
||||
.B t
|
||||
Toggle the display of the
|
||||
.I top
|
||||
process.
|
||||
.SH "THE DISPLAY"
|
||||
The actual display varies depending on the specific variant of Unix
|
||||
that the machine is running. This description may not exactly match
|
||||
|
||||
+5
-19
@@ -185,9 +185,9 @@ char *argv[];
|
||||
fd_set readfds;
|
||||
|
||||
#ifdef ORDER
|
||||
static char command_chars[] = "\f qh?en#sdkriIuto";
|
||||
static char command_chars[] = "\f qh?en#sdkriIuo";
|
||||
#else
|
||||
static char command_chars[] = "\f qh?en#sdkriIut";
|
||||
static char command_chars[] = "\f qh?en#sdkriIu";
|
||||
#endif
|
||||
/* these defines enumerate the "strchr"s of the commands in command_chars */
|
||||
#define CMD_redraw 0
|
||||
@@ -206,9 +206,8 @@ char *argv[];
|
||||
#define CMD_idletog 12
|
||||
#define CMD_idletog2 13
|
||||
#define CMD_user 14
|
||||
#define CMD_selftog 15
|
||||
#ifdef ORDER
|
||||
#define CMD_order 16
|
||||
#define CMD_order 15
|
||||
#endif
|
||||
|
||||
/* set the buffer for stdout */
|
||||
@@ -233,7 +232,6 @@ char *argv[];
|
||||
|
||||
/* initialize some selection options */
|
||||
ps.idle = Yes;
|
||||
ps.self = -1;
|
||||
ps.system = No;
|
||||
ps.uid = -1;
|
||||
ps.command = NULL;
|
||||
@@ -261,7 +259,7 @@ char *argv[];
|
||||
optind = 1;
|
||||
}
|
||||
|
||||
while ((i = getopt(ac, av, "SIbinqus:d:U:o:t")) != EOF)
|
||||
while ((i = getopt(ac, av, "SIbinqus:d:U:o:")) != EOF)
|
||||
{
|
||||
switch(i)
|
||||
{
|
||||
@@ -346,14 +344,10 @@ char *argv[];
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 't':
|
||||
ps.self = (ps.self == -1) ? getpid() : -1;
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "\
|
||||
Top version %s\n\
|
||||
Usage: %s [-ISbinqut] [-d x] [-s x] [-o field] [-U username] [number]\n",
|
||||
Usage: %s [-ISbinqu] [-d x] [-s x] [-o field] [-U username] [number]\n",
|
||||
version_string(), myname);
|
||||
exit(1);
|
||||
}
|
||||
@@ -843,14 +837,6 @@ Usage: %s [-ISbinqut] [-d x] [-s x] [-o field] [-U username] [number]\n",
|
||||
putchar('\r');
|
||||
break;
|
||||
|
||||
case CMD_selftog:
|
||||
ps.self = (ps.self == -1) ? getpid() : -1;
|
||||
new_message(MT_standout | MT_delayed,
|
||||
" %sisplaying self.",
|
||||
(ps.self == -1) ? "D" : "Not d");
|
||||
putchar('\r');
|
||||
break;
|
||||
|
||||
case CMD_user:
|
||||
new_message(MT_standout,
|
||||
"Username to show: ");
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
# SUCH DAMAGE.
|
||||
#
|
||||
# $Id:$
|
||||
# @(#)MAKEDEV.local 5.1 (Berkeley) 3/22/91
|
||||
#
|
||||
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
# $Id:$
|
||||
#
|
||||
# System-wide .cshrc file for csh(1).
|
||||
@@ -1,5 +1,3 @@
|
||||
# $Id:$
|
||||
#
|
||||
# System-wide .login file for csh(1).
|
||||
# Uncomment this to give you the default 4.2 behavior, where disk
|
||||
# information is shown in K-Blocks
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
# $Id:$
|
||||
#
|
||||
# System-wide .logout file for csh(1).
|
||||
@@ -1,6 +1,5 @@
|
||||
#!/bin/sh -
|
||||
#
|
||||
# $Id:$
|
||||
# @(#)daily 5.12 (Berkeley) 5/24/91
|
||||
#
|
||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#
|
||||
# Game Control File
|
||||
# $Id:$
|
||||
# @(#)dm.conf 5.5 (Berkeley) 4/12/89
|
||||
#
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
# $Id:$
|
||||
#
|
||||
# Disk geometry and partition layout tables.
|
||||
# Key:
|
||||
# dt controller type
|
||||
|
||||
+1
-10
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh -
|
||||
#
|
||||
# $Id: rc.i386,v 1.18.2.10 1998/03/07 09:06:19 jkh Exp $
|
||||
# $Id: rc.i386,v 1.18.2.9 1997/09/14 12:17:26 jkh Exp $
|
||||
# Do i386 specific processing
|
||||
#
|
||||
|
||||
@@ -104,15 +104,6 @@ if [ "X${moused_enable}" = X"YES" ] ; then
|
||||
moused ${moused_flags} -p ${moused_port} -t ${moused_type}
|
||||
vidcontrol <${viddev} -m on
|
||||
fi
|
||||
|
||||
# set this mode for all virtual screens
|
||||
if [ "X${allscreens_flags}" != X"" ] ; then
|
||||
echo -n ' allscreens'
|
||||
for ttyv in /dev/ttyv*
|
||||
do
|
||||
vidcontrol <$ttyv ${allscreens_flags}
|
||||
done
|
||||
fi
|
||||
echo '.'
|
||||
|
||||
# interrupts for /dev/random device
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
# $Id:$
|
||||
#
|
||||
# list of users disallowed any ftp access.
|
||||
# read by ftpd(8).
|
||||
root
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# $Id:$
|
||||
# from: @(#)gettytab 5.14 (Berkeley) 3/27/91
|
||||
#
|
||||
# Most of the table entries here are just copies of the old getty table,
|
||||
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
# $Id: host.conf,v 1.5 1998/11/16 02:02:30 jkh Exp $
|
||||
# First try the /etc/hosts file
|
||||
hosts
|
||||
# Now try the nameserver next.
|
||||
# $Id$
|
||||
# Default is to use the nameserver first
|
||||
bind
|
||||
# If that doesn't work, then try the /etc/hosts file
|
||||
hosts
|
||||
# If you have YP/NIS configured, uncomment the next line
|
||||
# nis
|
||||
@@ -1,4 +1,2 @@
|
||||
# $Id:$
|
||||
#
|
||||
#localhost
|
||||
#my_very_good_friend.domain
|
||||
@@ -1,4 +1,2 @@
|
||||
# $Id:$
|
||||
#
|
||||
# See lpd(8)
|
||||
#machine.domain
|
||||
@@ -1,4 +1,3 @@
|
||||
# $Id:$
|
||||
#
|
||||
# Internet server configuration database
|
||||
#
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# $Id:$
|
||||
# @(#)README 5.1 (Berkeley) 6/30/90
|
||||
|
||||
Notes about the contents of the /etc/kerberosIV directory:
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
# $Id:$
|
||||
#
|
||||
# Login access control table.
|
||||
#
|
||||
# When someone logs in, the table is scanned for the first entry that
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
# $Id:$
|
||||
|
||||
default:
|
||||
.if exists(/etc/mail/ips.txt)
|
||||
mv -f /etc/mail/ips.txt /etc/mail/ips.txt.0
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
# $Id:$
|
||||
|
||||
Filtering out SPAM from your site
|
||||
|
||||
Introduction:
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
# $Id:$
|
||||
#
|
||||
# list of hosts and domains for whom we relay mail.
|
||||
# all .forward hosts, domains must be listed in this file.
|
||||
# same for hosts and domains in /etc/aliases
|
||||
|
||||
+2
-9
@@ -1,4 +1,4 @@
|
||||
# $Id: make.conf,v 1.37.2.16 1998/08/01 19:58:19 dima Exp $
|
||||
# $Id: make.conf,v 1.37.2.14 1998/05/19 13:48:24 thepish Exp $
|
||||
#
|
||||
# This file, if present, will be read by make (see /usr/share/mk/sys.mk).
|
||||
# It allows you to override macro definitions to make without changing
|
||||
@@ -64,7 +64,7 @@
|
||||
# Default format for system documentation, depends on your printer.
|
||||
# Set this to "ascii" for simple printers or screen
|
||||
#
|
||||
#PRINTERDEVICE= ps
|
||||
#PRINTER= ps
|
||||
#
|
||||
#
|
||||
# How long to wait for a console keypress before booting the default kernel.
|
||||
@@ -202,13 +202,6 @@
|
||||
#MAKE_KERBEROS4= yes
|
||||
#
|
||||
#
|
||||
# Kerberos5
|
||||
# If you want to install Kerberos5 somewhere other than /usr/local,
|
||||
# define this:
|
||||
#
|
||||
#KRB5_HOME= /usr/local/krb5
|
||||
#
|
||||
#
|
||||
# CVSup update flags. Edit SUPFILE settings to reflect whichever distribution
|
||||
# file(s) you use on your site (see /usr/share/examples/cvsup/README for more
|
||||
# information on CVSup and these files). To use, do "make update" in /usr/src.
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#
|
||||
# $Id:$
|
||||
# @(#)modems 3/24/95
|
||||
#
|
||||
# modems -- modem configuration data base file
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#!/bin/sh -
|
||||
#
|
||||
# $Id:$
|
||||
# @(#)monthly 5.5 (Berkeley) 6/17/91
|
||||
#
|
||||
|
||||
|
||||
Loaded 100 of 820 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user