From: Andi Gutmans Date: Mon, 21 Aug 2000 04:30:25 +0000 (+0000) Subject: - Remove old/deprecated version of expand_filepath X-Git-Tag: php-4.0.2RC1~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=99d3b9bfe82f7852b1d2b06af34c9d9b009a3f4c;p=php - Remove old/deprecated version of expand_filepath --- diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index 406c295e0b..c6aea3d003 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -1063,8 +1063,6 @@ PHPAPI char *php_strip_url_passwd(char *url) } -#if 1 - PHPAPI char *expand_filepath(const char *filepath, char *real_path) { cwd_state new_state; @@ -1094,49 +1092,6 @@ PHPAPI char *expand_filepath(const char *filepath, char *real_path) return real_path; } -#else - -PHPAPI char *expand_filepath(char *filepath) -{ - char *retval = NULL; - - if (filepath[0] == '.') { - char *cwd = malloc(MAXPATHLEN + 1); - - if (V_GETCWD(cwd, MAXPATHLEN)) { - char *cwd_end = cwd + strlen(cwd); - - if (filepath[1] == '.') { /* parent directory - .. */ - /* erase the last directory name from the path */ -#ifdef PHP_WIN32 - while (*cwd_end != '/' || *cwd_end != '\\') { -#else - while (*cwd_end != '/') { -#endif - *cwd_end-- = 0; - } - filepath++; /* make filepath appear as a current directory path */ - } -#ifdef 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); - strcpy(retval, cwd); - strcat(retval, filepath + 1); - free(cwd); - } - } - if (!retval) { - retval = strdup(filepath); - } - return retval; -} - -#endif /* * Local variables: