home *** CD-ROM | disk | FTP | other *** search
-
- /*
- * EXPAND_PATH.C
- *
- * $Header: Beta:src/uucp/src/lib/RCS/lockfile.c,v 1.1 90/02/02 12:08:31 dillon Exp Locker: dillon $
- */
-
- #include <stdio.h>
- #include <string.h>
- #include "config.h"
-
- Prototype char *expand_path(const char *, const char *);
-
- char *
- expand_path(const char *path, const char *file_name)
- {
- register const char *p;
- static char name[256];
-
- /*
- * If the file_name is a full path name, use that.
- */
-
- p = strchr(file_name, ':');
-
- if ((p != NULL) && (p != file_name))
- return ((char *)file_name);
-
- /*
- * If the path ends in ':' or '/', don't add separator!
- */
-
- p = &path[strlen(path)-1];
- sprintf(name, (*p == ':' || *p == '/') ? "%s%s" : "%s/%s", path, file_name);
- return (name);
- }
-
-