mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-26 09:56:29 -05:00
New .snapraidignore feature
This commit is contained in:
parent
6a912b4726
commit
36cef9ee89
52 changed files with 2278 additions and 158 deletions
|
|
@ -911,8 +911,8 @@ void pathimport(char* dst, size_t size, const char* src)
|
|||
pathcpy(dst, size, src);
|
||||
|
||||
#ifdef _WIN32
|
||||
/* convert the Windows dir separator '\' to C '/', */
|
||||
/* and the Windows escaping char '^' to the fnmatch '\' */
|
||||
/* convert the Windows dir separator '\' to C '/', */
|
||||
/* and the Windows escaping char '^' to the fnmatch '\' */
|
||||
while (*dst) {
|
||||
switch (*dst) {
|
||||
case '\\' :
|
||||
|
|
@ -1013,6 +1013,30 @@ int pathcmp(const char* a, const char* b)
|
|||
#endif
|
||||
}
|
||||
|
||||
int path_is_root_of(const char* root, const char* path)
|
||||
{
|
||||
while (*root && *path) {
|
||||
#ifdef _WIN32
|
||||
/* case insensitive compare in Windows */
|
||||
char r = tolower((unsigned char)*root);
|
||||
char p = tolower((unsigned char)*path);
|
||||
if (r == '\\')
|
||||
r = '/';
|
||||
if (p == '\\')
|
||||
p = '/';
|
||||
if (r != p)
|
||||
return 0;
|
||||
#else
|
||||
if (*root != *path)
|
||||
return 0;
|
||||
#endif
|
||||
++root;
|
||||
++path;
|
||||
}
|
||||
|
||||
return *root == 0 && *path != 0;
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
/* file-system */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue