Convert Windows slash to C slash in the disk mount point.

This commit is contained in:
Andrea Mazzoleni 2011-05-02 20:32:54 +02:00
parent ef1b061022
commit cfbe9343ae
3 changed files with 25 additions and 1 deletions

17
util.c
View file

@ -178,6 +178,23 @@ void pathcpy(char* str, size_t size, const char* src)
memcpy(str, src, len + 1);
}
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] = '/';
}
#endif
}
void pathprint(char* str, size_t size, const char* format, ...)
{
size_t len;