mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
Added inline function vfs_path_get_last_path_vfs()
...to simple get VFS class for last path element without malloc/free operations. Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
parent
6cde215e0e
commit
893ed22259
@ -91,4 +91,16 @@ vfs_path_get_last_path_str (const vfs_path_t * vpath)
|
||||
return (element != NULL) ? element->path : NULL;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
static inline struct vfs_class *
|
||||
vfs_path_get_last_path_vfs (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->class : NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user