fix win directory access in YAP.

This commit is contained in:
U-WIN-U2045GN0RNQ\Vítor Santos Costa 2011-08-18 22:33:49 +01:00
parent 0e2da3c3e0
commit 5fa4da2e22

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;