mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-28 19:06:42 -05:00
In Windows convert backslash to forward slash.
This commit is contained in:
parent
61eb8e802f
commit
5a2e118c38
9 changed files with 25 additions and 21 deletions
13
util.c
13
util.c
|
|
@ -180,17 +180,14 @@ void pathcpy(char* str, size_t size, const char* src)
|
|||
|
||||
void pathimport(char* str, size_t size, const char* src)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
size_t len;
|
||||
#endif
|
||||
|
||||
pathcpy(str, size, src);
|
||||
|
||||
#ifdef _WIN32
|
||||
/* convert last \ to / */
|
||||
len = strlen(str);
|
||||
if (len && str[len-1] == '\\') {
|
||||
str[len-1] = '/';
|
||||
/* convert all Windows '\' to '/' */
|
||||
while (*str) {
|
||||
if (*str == '\\')
|
||||
*str = '/';
|
||||
++str;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue