|
| iMatix home page | << | < | > | >> |
SFLVersion 2.11 |
#include "sflfile.h"
char
*strip_file_name (
char *name)
Returns the path for a fully-qualified filename. The path is cleaned-up and resolved. The returned string is held in a static area that should be copied directly after calling this function. The returned path does not end in '/' unless that is the entire path. If the supplied name contains no path, the returned path is ".".
{
char *path_end;
ASSERT (name);
ASSERT (strlen (name) <= LINE_MAX);
strcpy (work_name, name);
path_end = strrchr (work_name, PATHEND);
#if (defined (MSDOS_FILESYSTEM))
if (path_end == NULL)
path_end = strrchr (work_name, '/');
#endif
if (path_end == NULL)
return (".");
else
{
path_end [1] = '\0';
return (clean path (work_name));
}
}
| | << | < | > | >> |
|