DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T g

⟦3ac696b81⟧ TextFile

    Length: 897 (0x381)
    Types: TextFile
    Names: »glue.c«

Derivation

└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
    └─ ⟦this⟧ »EUUGD11/euug-87hel/sec1/shar/glue.c« 

TextFile

/*
**  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);
}