Files
mop3/kernel/fs/path.c
kamkow1 c8fb575bdd
All checks were successful
Build ISO image / build-and-deploy (push) Successful in 2m7s
Build documentation / build-and-deploy (push) Successful in 39s
Change formatting rules
2026-04-24 01:54:48 +02:00

24 lines
368 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;
}