projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
date and time created 91/03/14 12:01:54 by donn
[unix-history]
/
usr
/
src
/
bin
/
csh
/
csh.c
diff --git
a/usr/src/bin/csh/csh.c
b/usr/src/bin/csh/csh.c
index
8a04c62
..
787d169
100644
(file)
--- a/
usr/src/bin/csh/csh.c
+++ b/
usr/src/bin/csh/csh.c
@@
-5,7
+5,7
@@
*/
#ifndef lint
*/
#ifndef lint
-static char *sccsid = "@(#)csh.c 5.1
4
(Berkeley) %G%";
+static char *sccsid = "@(#)csh.c 5.1
7
(Berkeley) %G%";
#endif
#include "sh.h"
#endif
#include "sh.h"
@@
-42,20
+42,22
@@
bool enterhist = 0;
extern gid_t getegid(), getgid();
extern uid_t geteuid(), getuid();
extern gid_t getegid(), getgid();
extern uid_t geteuid(), getuid();
-main(c, av)
- int c;
- char **av;
+void pintr(), pchild(), srcunit();
+
+main(argc, argv)
+ int argc;
+ char **argv;
{
register char **v, *cp;
register int f;
struct sigvec osv;
settimes(); /* Immed. estab. timing base */
{
register char **v, *cp;
register int f;
struct sigvec osv;
settimes(); /* Immed. estab. timing base */
- v = av;
+ v = a
rg
v;
if (eq(v[0], "a.out")) /* A.out's are quittable */
quitit = 1;
uid = getuid();
if (eq(v[0], "a.out")) /* A.out's are quittable */
quitit = 1;
uid = getuid();
- loginsh = **v == '-' && c == 1;
+ loginsh = **v == '-' &&
arg
c == 1;
if (loginsh)
(void) time(&chktim);
if (loginsh)
(void) time(&chktim);
@@
-127,8
+129,8
@@
main(c, av)
* Note that processing of -v/-x is actually delayed till after
* script processing.
*/
* Note that processing of -v/-x is actually delayed till after
* script processing.
*/
- c--, v++;
- while (c > 0 && (cp = v[0])[0] == '-' && *++cp != '\0' && !batch) {
+
arg
c--, v++;
+ while (
arg
c > 0 && (cp = v[0])[0] == '-' && *++cp != '\0' && !batch) {
do switch (*cp++) {
case 'b': /* -b Next arg is input file */
do switch (*cp++) {
case 'b': /* -b Next arg is input file */
@@
-136,9
+138,9
@@
main(c, av)
break;
case 'c': /* -c Command input from arg */
break;
case 'c': /* -c Command input from arg */
- if (c == 1)
+ if (
arg
c == 1)
exit(0);
exit(0);
- c--, v++;
+
arg
c--, v++;
arginp = v[0];
prompt = 0;
nofile++;
arginp = v[0];
prompt = 0;
nofile++;
@@
-196,7
+198,7
@@
main(c, av)
break;
} while (*cp);
break;
} while (*cp);
- v++, c--;
+ v++,
arg
c--;
}
if (quitit) /* With all due haste, for debugging */
}
if (quitit) /* With all due haste, for debugging */
@@
-207,7
+209,7
@@
main(c, av)
* are remaining arguments the first of them is the name
* of a shell file from which to read commands.
*/
* are remaining arguments the first of them is the name
* of a shell file from which to read commands.
*/
- if (nofile == 0 && c > 0) {
+ if (nofile == 0 &&
arg
c > 0) {
nofile = open(v[0], 0);
if (nofile < 0) {
child++; /* So this ... */
nofile = open(v[0], 0);
if (nofile < 0) {
child++; /* So this ... */
@@
-217,7
+219,7
@@
main(c, av)
SHIN = dmove(nofile, FSHIN); /* Replace FSHIN */
(void) ioctl(SHIN, FIOCLEX, (char *)0);
prompt = 0;
SHIN = dmove(nofile, FSHIN); /* Replace FSHIN */
(void) ioctl(SHIN, FIOCLEX, (char *)0);
prompt = 0;
- c--, v++;
+
arg
c--, v++;
}
if (!batch && (uid != geteuid() || getgid() != getegid())) {
errno = EACCES;
}
if (!batch && (uid != geteuid() || getgid() != getegid())) {
errno = EACCES;
@@
-259,7
+261,7
@@
main(c, av)
shpgrp = getpgrp(0);
opgrp = tpgrp = -1;
if (setintr) {
shpgrp = getpgrp(0);
opgrp = tpgrp = -1;
if (setintr) {
- **av = '-';
+ **a
rg
v = '-';
if (!quitit) /* Wary! */
(void) signal(SIGQUIT, SIG_IGN);
(void) signal(SIGINT, pintr);
if (!quitit) /* Wary! */
(void) signal(SIGQUIT, SIG_IGN);
(void) signal(SIGINT, pintr);
@@
-436,7
+438,7
@@
srccat(cp, dp)
* This occurs on ".cshrc"s and the like.
*/
int insource;
* This occurs on ".cshrc"s and the like.
*/
int insource;
-static
+static
void
srcunit(unit, onlyown, hflg)
register int unit;
bool onlyown, hflg;
srcunit(unit, onlyown, hflg)
register int unit;
bool onlyown, hflg;
@@
-623,6
+625,7
@@
char *jobargv[2] = { "jobs", 0 };
* and finally go through the normal error mechanism, which
* gets a chance to make the shell go away.
*/
* and finally go through the normal error mechanism, which
* gets a chance to make the shell go away.
*/
+void
pintr()
{
pintr1(1);
pintr()
{
pintr1(1);