mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
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:
parent
a337f84ded
commit
6cde215e0e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user