Added dirname() function
This commit is contained in:
parent
1e68c71d72
commit
efd9d3d312
3 changed files with 44 additions and 0 deletions
18
test/t_path2.c
Normal file
18
test/t_path2.c
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
#include <malloc.h>
|
||||
#include <stdio.h>
|
||||
#include "../src/common/path.h"
|
||||
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
char fp[] = "/this/is/my/path/to/file.pdf/";
|
||||
char *d;
|
||||
printf("%s\n=>\n", fp);
|
||||
|
||||
d = dirname(fp);
|
||||
|
||||
printf("%s\n", d);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in a new issue