Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libc/gen/basename_compat.c
Show All 19 Lines | |||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include <errno.h> | #include <errno.h> | ||||
#include <libgen.h> | #include <libgen.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
char * __freebsd11_basename_r(const char *path, char *bname); | |||||
char * __freebsd11_basename(char *path); | |||||
char * | char * | ||||
__freebsd11_basename_r(const char *path, char *bname) | __freebsd11_basename_r(const char *path, char *bname) | ||||
{ | { | ||||
const char *endp, *startp; | const char *endp, *startp; | ||||
size_t len; | size_t len; | ||||
/* Empty or NULL string gets treated as "." */ | /* Empty or NULL string gets treated as "." */ | ||||
if (path == NULL || *path == '\0') { | if (path == NULL || *path == '\0') { | ||||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |