1
0
mirror of https://github.com/php/php-src.git synced 2026-04-08 16:43:44 +02:00

- Fix bug 3640

This commit is contained in:
Andi Gutmans
2000-02-27 05:22:48 +00:00
parent 908cdfafe1
commit 312071bd08

View File

@@ -975,12 +975,20 @@ PHPAPI char *expand_filepath(char *filepath)
if (filepath[1] == '.') { /* parent directory - .. */
/* erase the last directory name from the path */
#if PHP_WIN32
while (*cwd_end != '/' || *cwd_end != '\\') {
#else
while (*cwd_end != '/') {
#endif
*cwd_end-- = 0;
}
filepath++; /* make filepath appear as a current directory path */
}
#if PHP_WIN32
if (cwd_end > cwd && (*cwd_end == '/' || *cwd_end == '\\')) { /* remove trailing slashes */
#else
if (cwd_end > cwd && *cwd_end == '/') { /* remove trailing slashes */
#endif
*cwd_end-- = 0;
}
retval = (char *) malloc(strlen(cwd) + strlen(filepath) - 1 + 1);