Merge pull request #8941 from LazyBumHorse/master

path_relative_to: fix my stupid return in void function
This commit is contained in:
Twinaphex 2019-06-08 21:54:43 +02:00 committed by GitHub
commit 362750b84a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -781,10 +781,13 @@ void path_relative_to(char *out, const char *path, const char *base, size_t size
#ifdef _WIN32 #ifdef _WIN32
/* For different drives, return absolute path */ /* For different drives, return absolute path */
if (strlen(path) > 2 && strlen(base) > 2) if (strlen(path) >= 2 && strlen(base) >= 2
if (path[1] == ':' && base[1] == ':') && path[1] == ':' && base[1] == ':'
if (path[0] != base[0]) && path[0] != base[0])
return path; {
out[0] = '\0';
strlcat(out, path, size);
}
#endif #endif
/* Trim common beginning */ /* Trim common beginning */