/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2011 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* Glenn Fowler
* AT&T Research
*
* return full path to p with mode access using $PATH
* a!=0 enables related root search
* a!=0 && a!="" searches a dir first
* the related root must have a bin subdir
* p==0 sets the cached relative dir to a
* full path returned in path buffer
* if path==0 then the space is malloc'd
*/
#include <ast.h>
char*
{
}
#include <ast_api.h>
char*
{
register char* s;
char* x;
static char* cmd;
if (!path)
if (!p)
{
if (cmd)
return 0;
}
{
{
{
}
}
}
if (*p == '/')
a = 0;
else if (s = (char*)a)
{
x = s;
if (strchr(p, '/'))
{
a = p;
p = "..";
}
else
a = 0;
{
if (!cmd && *s == '/')
{
for (;;)
{
{
goto normal;
}
}
normal: ;
}
}
}
}