/* bind for OS/2
 * bjorn@mork.no
 */
#include "port_before.h"
#include <limits.h>
#include "paths.h"

char *getos2path(char *sysvar, char *filename)
{
	static char buf[PATH_MAX];
	char *p;

	if ((p = (char *)getenv(sysvar)) &&
	  ((strlen(p) + strlen(filename)) < sizeof(buf))) {
		strcpy(buf, p);
		if (filename[0] != '/') strcat(buf, "/");
		strcat(buf, filename);
		return buf;
	}
	return filename;	
}

