mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Add support for escaping in Windows with the '^' char
This commit is contained in:
parent
ecff017ffe
commit
8fbd8b35ea
5 changed files with 45 additions and 7 deletions
|
|
@ -638,10 +638,17 @@ void pathimport(char* dst, size_t size, const char* src)
|
|||
pathcpy(dst, size, src);
|
||||
|
||||
#ifdef _WIN32
|
||||
/* convert all Windows '\' to C '/' */
|
||||
/* convert the Windows dir separator '\' to C '/', */
|
||||
/* and the Windows escaping char '^' to the fnmatch '\' */
|
||||
while (*dst) {
|
||||
if (*dst == '\\')
|
||||
switch (*dst) {
|
||||
case '\\' :
|
||||
*dst = '/';
|
||||
break;
|
||||
case '^' :
|
||||
*dst = '\\';
|
||||
break;
|
||||
}
|
||||
++dst;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -652,10 +659,16 @@ void pathexport(char* dst, size_t size, const char* src)
|
|||
pathcpy(dst, size, src);
|
||||
|
||||
#ifdef _WIN32
|
||||
/* convert all C '/' to Windows '\' */
|
||||
/* invert the import */
|
||||
while (*dst) {
|
||||
if (*dst == '/')
|
||||
switch (*dst) {
|
||||
case '/' :
|
||||
*dst = '\\';
|
||||
break;
|
||||
case '\\' :
|
||||
*dst = '^';
|
||||
break;
|
||||
}
|
||||
++dst;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue