diff options
Diffstat (limited to 'src/port/path.c')
-rw-r--r-- | src/port/path.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/port/path.c b/src/port/path.c index df2c4e7be6d..0d40a0bb9c1 100644 --- a/src/port/path.c +++ b/src/port/path.c @@ -374,21 +374,22 @@ path_is_relative_and_below_cwd(const char *path) else if (path_contains_parent_reference(path)) return false; #ifdef WIN32 + /* - * On Win32, a drive letter _not_ followed by a slash, e.g. 'E:abc', is - * relative to the cwd on that drive, or the drive's root directory - * if that drive has no cwd. Because the path itself cannot tell us - * which is the case, we have to assume the worst, i.e. that it is not - * below the cwd. We could use GetFullPathName() to find the full path - * but that could change if the current directory for the drive changes - * underneath us, so we just disallow it. + * On Win32, a drive letter _not_ followed by a slash, e.g. 'E:abc', is + * relative to the cwd on that drive, or the drive's root directory if + * that drive has no cwd. Because the path itself cannot tell us which is + * the case, we have to assume the worst, i.e. that it is not below the + * cwd. We could use GetFullPathName() to find the full path but that + * could change if the current directory for the drive changes underneath + * us, so we just disallow it. */ else if (isalpha((unsigned char) path[0]) && path[1] == ':' && - !IS_DIR_SEP(path[2])) + !IS_DIR_SEP(path[2])) return false; #endif else - return true; + return true; } /* |