Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <errno.h>
- 2 #include "node.h"
- 3 #include "dir.h"
- 4
- 5 int getnoderelativeto(const char *path, struct node *root, struct node **node){
- 6 if (!S_ISDIR(root->vstat.st_mode)){
- 7 errno = ENOTDIR;
- 8 return 0;
- 9 }
- 10
- 11 if (path[0] != '/'){
- 12 errno = EINVAL;
- 13 return 0;
- 14 }
- 15
- 16 if (path[1] == '\0'){
- 17 *node = root;
- 18 return 1;
- 19 }
- 20
- 21 const char *name = path + 1;
- 22 int namelen = 0;
- 23 const char *name_end = name;
- 24
- 25 while (*name_end != '\0' )
- 26 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement