MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / _get_path_lastname

Function _get_path_lastname

components/dfs/dfs_v2/src/dfs_file.c:2916–2924  ·  view source on GitHub ↗

* @brief Extract the last component from a path string * * This function extracts the filename or last directory name from a given path. * It searches for the last '/' character and returns the substring after it. * * @param[in] path The input path string to process * * @return const char* Pointer to: * - The last path component if '/' is found * - The original path if no

Source from the content-addressed store, hash-verified

2914 * - NULL if input path is NULL
2915 */
2916static const char *_get_path_lastname(const char *path)
2917{
2918 char *ptr;
2919 if ((ptr = (char *)strrchr(path, '/')) == NULL)
2920 return path;
2921
2922 /* skip the '/' then return */
2923 return ++ptr;
2924}
2925
2926/**
2927 * @brief Copy files or directories from source to destination

Callers 1

copyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected