SCCS-vsn: bin/csh/csh.c 5.15
-static char *sccsid = "@(#)csh.c 5.14 (Berkeley) %G%";
+static char *sccsid = "@(#)csh.c 5.15 (Berkeley) %G%";
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;
+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 */
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 == '-' && argc == 1;
if (loginsh)
(void) time(&chktim);
if (loginsh)
(void) time(&chktim);
* 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) {
+ argc--, v++;
+ while (argc > 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 */
break;
case 'c': /* -c Command input from arg */
break;
case 'c': /* -c Command input from arg */
arginp = v[0];
prompt = 0;
nofile++;
arginp = v[0];
prompt = 0;
nofile++;
}
if (quitit) /* With all due haste, for debugging */
}
if (quitit) /* With all due haste, for debugging */
* 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 && argc > 0) {
nofile = open(v[0], 0);
if (nofile < 0) {
child++; /* So this ... */
nofile = open(v[0], 0);
if (nofile < 0) {
child++; /* So this ... */
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;
}
if (!batch && (uid != geteuid() || getgid() != getegid())) {
errno = EACCES;
}
if (!batch && (uid != geteuid() || getgid() != getegid())) {
errno = EACCES;
shpgrp = getpgrp(0);
opgrp = tpgrp = -1;
if (setintr) {
shpgrp = getpgrp(0);
opgrp = tpgrp = -1;
if (setintr) {
if (!quitit) /* Wary! */
(void) signal(SIGQUIT, SIG_IGN);
(void) signal(SIGINT, pintr);
if (!quitit) /* Wary! */
(void) signal(SIGQUIT, SIG_IGN);
(void) signal(SIGINT, pintr);