Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 5/3/83; site vax135.UUCP
Path: utzoo!linus!philabs!cmcl2!floyd!vax135!martin
From: martin@vax135.UUCP
Newsgroups: net.news.b
Subject: ifuncs.c fix to get noshell to work
Message-ID: <514@vax135.UUCP>
Date: Thu, 30-Jun-83 12:43:42 EDT
Article-I.D.: vax135.514
Posted: Thu Jun 30 12:43:42 1983
Date-Received: Fri, 1-Jul-83 11:17:52 EDT
Organization: Bell Labs, Holmdel, NJ
Lines: 37

as well at the other bug/change that my previouse article talked about,
there is also a change to get the file name to execv to work.
the lines with the '!' are the ones that changes.

		if (pid = fork())
			fwait(pid);
		else {
			close(0);
			open(TRANS, 0);
!			if (*sp->s_xmit == '\0')		/* need bfp? */
!				ptr = bfr;
!			else
!				ptr = sp->s_xmit;
			for (pid = 0; pid < 19; pid++) {
				while (isspace(*ptr))
					*ptr++ = 0;
				argv[pid] = ptr;
				while (!isspace(*++ptr) && *ptr)
					;
				if (!*ptr)
					break;
			}
			argv[++pid] = 0;
!			/*execv(sp->s_xmit, argv);	use argv[0] */
!			execv(argv[0], argv);
			xerror("Can't execv\n");
		}
	} else
		system(bfr);

it's about line 190 in 2.10 ifuncs.c. the code works fine if the command is
just one program with no arguments, but otherwise it passes the whole string
(args as well) to the execv as a path.
the problems comes with the S flag and a supplied command, hence the if
statment to allow for when no command is supplied.

martin levy.