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 - metrics - download
Index: T g

⟦ef11a3536⟧ TextFile

    Length: 984 (0x3d8)
    Types: TextFile
    Names: »getfpath.c«

Derivation

└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
    └─⟦dc59850a2⟧ »EurOpenD22/pp5.0/pp-5.tar.Z« 
        └─⟦e5a54fb17⟧ 
            └─⟦this⟧ »pp-5.0/Lib/util/getfpath.c« 

TextFile

/* getfpath: fix up pathnames */

# ifndef lint
static char Rcsid[] = "@(#)$Header: /cs/research/pp/hubris/pp-beta/Lib/util/RCS/getfpath.c,v 5.0 90/09/20 16:17:20 pp Exp Locker: pp $";
# endif

/*
 * $Header: /cs/research/pp/hubris/pp-beta/Lib/util/RCS/getfpath.c,v 5.0 90/09/20 16:17:20 pp Exp Locker: pp $
 *
 * $Log:	getfpath.c,v $
 * Revision 5.0  90/09/20  16:17:20  pp
 * rcsforce : 5.0 public release
 * 
 */



#include "util.h"

/*
 * convert a relative pathname into a full pathname - using base
 * as the secret ingredient
 */


void getfpath (base, prog, buf)
char    *base, *prog, *buf;
{
	if (*prog == '/' || strncmp (prog, "./", 2) == 0 ||
	    strncmp (prog, "../", 3) == 0)
		 (void) strcpy (buf, prog);
	else
		 (void) sprintf (buf, "%s/%s", base, prog);
}

/*
 * as above, but no buffer supplied, grab space off the heap
 */

char *dupfpath (base, prog)
char    *base, *prog;
{
	char    tmpbuf[FILNSIZE];

	getfpath (base, prog, tmpbuf);
	return strdup (tmpbuf);
}