LICENSE IPL10
The pts program has a command 'source' to read commands from
a file. In the interactive "shell" mode, this command works,
reading and executing commands until the end of the file and
then returning to the command shell.
This command is valid for use as a command line option, but
does not work. It requires a valid filename as an argument,
but does not process the file, instead just dropping the user
into the interactive mode.
When given as a command line option, pts source SHOULD read
the file, execute the commands and then exit, according to
the documentation. It does not currently do this and should
be fixed.
int
pts_Interactive(struct cmd_syndesc *as, void *arock)
{
+ source = stdin;
finished = 0;
return 0;
}
cmd_SetBeforeProc(GetGlobals, &state);
finished = 1;
- source = stdin;
+ source = NULL;
if (code = cmd_Dispatch(argc, argv)) {
CleanUp(NULL, NULL);
exit(1);
}
- while (!finished) {
+ while (source && !finished) {
if (isatty(fileno(source)))
fprintf(stderr, "pts> ");
if (!fgets(line, sizeof line, source)) {