Archived
1
0
Fork 0

Added dirname() function

This commit is contained in:
Fredric N 2010-04-22 21:37:52 +02:00 committed by Henrik Hautakoski
parent 1e68c71d72
commit efd9d3d312
3 changed files with 44 additions and 0 deletions

View file

@ -14,6 +14,9 @@ raw_inotify :
path :
$(CC) -D__DEBUG__ $(CFLAGS) ../src/common/path.c t_path.c -o test_path
path2 :
$(CC) -D__DEBUG__ $(CFLAGS) ../src/common/path.c t_path2.c -o test_path2
rbtree :
$(CC) -D RB_DEBUG $(CFLAGS) ../src/common/rbtree.c t_rbtree.c -o test_rbtree

18
test/t_path2.c Normal file
View 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;
}