home *** CD-ROM | disk | FTP | other *** search
- /* pathname.c - Construct a pathname from a directory and basename
- *
- * SYNOPSIS
- * char *pathname (char *directory, char *name)
- *
- * RETURNS
- * Returns "directory" + "/" + "name" (copied into static
- * storage), or a pointer to "name" if "directory" is null.
- *
- * Copyright (c) 1991, 1992 Tim Cook.
- * Non-profit distribution allowed. See README for details.
- */
-
- static char rcsid[] = "$Id: pathname.c,v 1.1 1992/12/02 03:48:38 tim Exp $";
-
- #include "config.h"
- #include <sys/param.h>
-
- #ifndef MAXPATHLEN
- #define MAXPATHLEN 1024
- #endif
-
-
- char *pathname (directory, name)
- char *directory, *name ;
- {
- static char return_value[MAXPATHLEN+1] ;
-
- if (directory && *directory != EOS) {
- strcpy (return_value, directory) ;
- strcat (return_value, "/") ;
- strcat (return_value, name) ;
- return return_value ; }
- else
- return name ;
- }
-