Rev 4153 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 4153 | Rev 4327 | ||
|---|---|---|---|
| Line 60... | Line 60... | ||
| 60 | * @return Zero on match, non-zero otherwise. |
60 | * @return Zero on match, non-zero otherwise. |
| 61 | */ |
61 | */ |
| 62 | int fat_dentry_namecmp(char *name, const char *component) |
62 | int fat_dentry_namecmp(char *name, const char *component) |
| 63 | { |
63 | { |
| 64 | int rc; |
64 | int rc; |
| - | 65 | size_t size; |
|
| - | 66 | ||
| 65 | if (!(rc = stricmp(name, component))) |
67 | if (!(rc = stricmp(name, component))) |
| 66 | return rc; |
68 | return rc; |
| 67 | if (!strchr(name, '.')) { |
69 | if (!str_chr(name, '.')) { |
| 68 | /* |
70 | /* |
| 69 | * There is no '.' in the name, so we know that there is enough |
71 | * There is no '.' in the name, so we know that there is enough |
| 70 | * space for appending an extra '.' to name. |
72 | * space for appending an extra '.' to name. |
| 71 | */ |
73 | */ |
| - | 74 | size = str_size(name); |
|
| 72 | name[strlen(name)] = '.'; |
75 | name[size] = '.'; |
| 73 | name[strlen(name) + 1] = '\0'; |
76 | name[size + 1] = '\0'; |
| 74 | rc = stricmp(name, component); |
77 | rc = stricmp(name, component); |
| 75 | } |
78 | } |
| 76 | return rc; |
79 | return rc; |
| 77 | } |
80 | } |
| 78 | 81 | ||