Files
mop3/kernel/fs/path.c
kamkow1 704db2dfa4
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m41s
Volume-centric VFS implementation
2026-02-25 08:53:54 +01:00

24 lines
369 B
C

#include <fs/vfs.h>
#include <libk/std.h>
#include <path_defs.h>
const char* path_basename (const char* path) {
if (path == NULL)
return NULL;
const char* last_slash = NULL;
const char* ptr = path;
while (*ptr != '\0') {
if (*ptr == '/')
last_slash = ptr;
ptr++;
}
if (last_slash == NULL)
return path;
return last_slash + 1;
}