Changeset 14c331a in mainline
- Timestamp:
- 2008-11-25T12:14:31Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 46321fb
- Parents:
- 49df572
- Location:
- uspace/srv/fs/fat
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_dentry.c
r49df572 r14c331a 38 38 #include "fat_dentry.h" 39 39 #include <ctype.h> 40 #include <string.h> 40 41 41 42 #define FAT_PAD ' ' … … 52 53 else 53 54 return false; 55 } 56 57 /** Compare path component with the name read from the dentry. 58 * 59 * This function compares the path component with the name read from the dentry. 60 * The comparison is case insensitive and tolerates a mismatch on the trailing 61 * dot character at the end of the name (i.e. when there is a dot, but no 62 * extension). 63 * 64 * @param name Node name read from the dentry. 65 * @param component Path component. 66 * 67 * @return Zero on match, non-zero otherwise. 68 */ 69 int fat_dentry_namecmp(char *name, const char *component) 70 { 71 int rc; 72 if (!(rc = stricmp(name, component))) 73 return rc; 74 if (!strchr(name, '.')) { 75 /* 76 * There is no '.' in the name, so we know that there is enough 77 * space for appending an extra '.' to name. 78 */ 79 name[strlen(name)] = '.'; 80 name[strlen(name) + 1] = '\0'; 81 rc = stricmp(name, component); 82 } 83 return rc; 54 84 } 55 85 -
uspace/srv/fs/fat/fat_dentry.h
r49df572 r14c331a 73 73 } __attribute__ ((packed)) fat_dentry_t; 74 74 75 extern int fat_dentry_namecmp(char *, const char *); 75 76 extern bool fat_dentry_name_verify(const char *); 76 77 extern void fat_dentry_name_get(const fat_dentry_t *, char *); -
uspace/srv/fs/fat/fat_ops.c
r49df572 r14c331a 517 517 break; 518 518 } 519 if ( stricmp(name, component) == 0) {519 if (fat_dentry_namecmp(name, component) == 0) { 520 520 /* hit */ 521 521 void *node;
Note:
See TracChangeset
for help on using the changeset viewer.