|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T g
Length: 897 (0x381)
Types: TextFile
Names: »glue.c«
└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
└─⟦this⟧ »EUUGD11/euug-87hel/sec1/shar/glue.c«
/*
** Subroutine to call the shell archive parser. This is "glue"
** between unshar and the parser proper.
*/
#include "shar.h"
RCS("$Header: glue.c,v 1.1 87/03/09 16:24:17 rs Exp $")
/*
** Copy the input to a temporary file, then call the shell parser.
*/
BinSh(Name, Stream, Pushback)
char *Name;
register FILE *Stream;
char *Pushback;
{
static char TEMP[] = "/tmp/shellXXXXXX";
register FILE *F;
char buff[BUFSIZ];
char *vec[MAX_WORDS];
Interactive = Name == NULL;
File = mktemp(TEMP);
F = fopen(File, "w");
(void)fputs(Pushback, F);
while (fgets(buff, sizeof buff, Stream))
(void)fputs(buff, F);
(void)fclose(Stream);
if ((Input = fopen(TEMP, "r")) == NULL)
fprintf(stderr, "Can't open %s, %s!?\n", TEMP, Ermsg(errno));
else
while (GetLine(TRUE))
if (Argify(vec))
(void)Exec(vec);
(void)unlink(TEMP);
}