Added inline function vfs_path_get_last_path_str()

...to simple get path string without malloc/free operations.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Slava Zanko 2011-07-23 16:18:53 +03:00
parent a337f84ded
commit 6cde215e0e

View File

@ -79,4 +79,16 @@ vfs_path_element_valid (const vfs_path_element_t * element)
return (element != NULL && element->class != NULL);
}
/* --------------------------------------------------------------------------------------------- */
static inline char *
vfs_path_get_last_path_str (const vfs_path_t * vpath)
{
const vfs_path_element_t *element;
if (vpath == NULL)
return NULL;
element = vfs_path_get_by_index (vpath, -1);
return (element != NULL) ? element->path : NULL;
}
#endif