/*---------------------------------------------------------------*/
/*   Copyright (c) 1988 Regents of the University of California  */
/*                 All Rights Reserved                           */
/*---------------------------------------------------------------*/
/*
      @(#)GetEnv.c	1.1   (UCLA/IGPP)   06 Apr 1994
*/
/*-- GetEnvOrDef.c ----------------------------------------------*/
/* Return the Value of the Enviromental Variable or the Defualt  */
/*                                                               */
/* Yes, this a simple function, but I use the same code in about */
/* 4 or 5 programs.                                              */
/*                                                               */
/* Began: 04/06/94 - Gilbert Hyatt                               */
/*---------------------------------------------------------------*/ 
#include <stdlib.h>
#include <string.h>

char*
GetEnvOrDef(envVar, fallBack)
char* envVar;
char* fallBack;
{
  char* value;
  
  if((value = getenv(envVar)) == NULL) return strdup(fallBack);
  else                                 return strdup(value);
}
    
