4 void dirname(char *dir
, char *path
)
6 char *slash
= strrchr(path
, '/');
8 size_t len
= slash
- path
+ 1;
9 memcpy(dir
, path
, len
);
16 void basename(char *name
, char *path
)
18 char *slash
= strrchr(path
, '/');
20 strcpy(name
, slash
+ 1);