mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Fix literal caret handling in Windows path normalization and wildcard matching
This commit is contained in:
parent
670ab0195b
commit
dd97bb2fa6
4 changed files with 130 additions and 23 deletions
|
|
@ -1094,19 +1094,10 @@ 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 '/' */
|
||||
while (*dst) {
|
||||
switch (*dst) {
|
||||
case '\\' :
|
||||
if (*dst == '\\')
|
||||
*dst = '/';
|
||||
break;
|
||||
case '^' :
|
||||
*dst = '\\';
|
||||
break;
|
||||
}
|
||||
++dst;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1117,16 +1108,10 @@ void pathexport(char* dst, size_t size, const char* src)
|
|||
pathcpy(dst, size, src);
|
||||
|
||||
#ifdef _WIN32
|
||||
/* invert the import */
|
||||
/* Convert C '/' to Windows dir separator '\' */
|
||||
while (*dst) {
|
||||
switch (*dst) {
|
||||
case '/' :
|
||||
if (*dst == '/')
|
||||
*dst = '\\';
|
||||
break;
|
||||
case '\\' :
|
||||
*dst = '^';
|
||||
break;
|
||||
}
|
||||
++dst;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue