windows path support.

This commit is contained in:
Vitor Santos Costa 2011-07-26 18:41:45 +01:00
parent 00949b8783
commit e145910234

View File

@ -1091,6 +1091,17 @@ canoniseFileName(char *path)
out = start = in;
}
#ifdef __MINGW32__ /* /c/ in MINGW is the same as c: */
if ( in[0] == '/' && isLetter(in[1]) &&
in[2] == '/' )
{
out[0] = in[1];
out[1] = ':';
in += 3;
out = start = in;
}
#endif
#endif
#ifdef O_HASSHARES /* //host/ */
if ( in[0] == '/' && in[1] == '/' && isAlpha(in[2]) )
@ -1426,6 +1437,12 @@ IsAbsolutePath(const char *p) /* /d:/ */
(p[3] == '/' || p[3] == '\0') )
succeed;
#ifdef __MINGW32__ /* /c/ in MINGW is the same as c: */
if ( p[0] == '/' && isLetter(p[1]) &&
(p[2] == '/' || p[2] == '\0') )
succeed;
#endif
if ( p[1] == ':' && isLetter(p[0]) && /* d:/ or d:\ */
(IS_DIR_SEPARATOR(p[2]) || p[2] == '\0') )
succeed;